Podcast
Questions and Answers
What is the maximum number of days a password may be used before expiration according to the given settings?
What is the maximum number of days a password may be used before expiration according to the given settings?
- 180 days (correct)
- 30 days
- 60 days
- 90 days
What does PASS_MIN_DAYS represent in the password policy?
What does PASS_MIN_DAYS represent in the password policy?
- Maximum allowed password length
- Number of days warning given before password expires
- Minimum number of days allowed between password changes (correct)
- Minimum number of days before a password can be reused
How many days of warning are given before a password expires according to the settings?
How many days of warning are given before a password expires according to the settings?
- 30 days
- 7 days (correct)
- 0 days
- 14 days
Which command is used to edit the configuration file to set password expiration to 180 days?
Which command is used to edit the configuration file to set password expiration to 180 days?
What is the purpose of the supplementary group created in the lab exercise?
What is the purpose of the supplementary group created in the lab exercise?
What is the purpose of a group in a system?
What is the purpose of a group in a system?
What does the 'x' represent in a line from the /etc/group file?
What does the 'x' represent in a line from the /etc/group file?
How is the primary group for a user typically designated?
How is the primary group for a user typically designated?
What is a characteristic of supplementary groups?
What is a characteristic of supplementary groups?
Where is the group membership for users stored?
Where is the group membership for users stored?
What does the id command display for a user?
What does the id command display for a user?
What is a User Private Group?
What is a User Private Group?
What command is used to switch to the root user in a login shell?
What command is used to switch to the root user in a login shell?
What does the command 'echo $PATH' display?
What does the command 'echo $PATH' display?
If more than five minutes have passed since the last authentication, what must the user do to run 'sudo' again?
If more than five minutes have passed since the last authentication, what must the user do to run 'sudo' again?
What does the command 'id' return when run by the root user?
What does the command 'id' return when run by the root user?
What happens to the PATH variable when using 'sudo' to become the root user?
What happens to the PATH variable when using 'sudo' to become the root user?
After switching to root, what would be the output of 'pwd'?
After switching to root, what would be the output of 'pwd'?
What is the primary effect of using 'sudo' instead of 'su' directly?
What is the primary effect of using 'sudo' instead of 'su' directly?
Which command must be run to display the home directory of the root user?
Which command must be run to display the home directory of the root user?
What does the prompt of the root user typically look like compared to a regular user?
What does the prompt of the root user typically look like compared to a regular user?
Which command is used to exit the root user shell and return to the student user's shell?
Which command is used to exit the root user shell and return to the student user's shell?
What command should be used to lock a user account using sudo?
What command should be used to lock a user account using sudo?
What will happen if a user tries to execute the sudo command without having permission?
What will happen if a user tries to execute the sudo command without having permission?
Which of the following commands provides access to the root account without running interactive login scripts?
Which of the following commands provides access to the root account without running interactive login scripts?
What is the purpose of using the visudo command?
What is the purpose of using the visudo command?
How can a member of the wheel group use sudo under Red Hat Enterprise Linux 7?
How can a member of the wheel group use sudo under Red Hat Enterprise Linux 7?
What does the % symbol indicate in the sudoers file configuration?
What does the % symbol indicate in the sudoers file configuration?
What log file is used to record executed sudo commands by default?
What log file is used to record executed sudo commands by default?
Which of the following best describes the sudo -i command?
Which of the following best describes the sudo -i command?
Which user is specifically notified when there is an unauthorized attempt to use a sudo command?
Which user is specifically notified when there is an unauthorized attempt to use a sudo command?
What does the command 'ALL=(ALL:ALL)' allow for users in the wheel group?
What does the command 'ALL=(ALL:ALL)' allow for users in the wheel group?
How can you provide sudo access to a user named user01?
How can you provide sudo access to a user named user01?
What is the meaning of the NOPASSWD command in a sudoers file?
What is the meaning of the NOPASSWD command in a sudoers file?
Which of the following is a correct line for granting the games group permission to run the id command as the operator user?
Which of the following is a correct line for granting the games group permission to run the id command as the operator user?
What security measure is recommended when using sudo with NOPASSWD?
What security measure is recommended when using sudo with NOPASSWD?
How can you tighten security after enabling sudo access?
How can you tighten security after enabling sudo access?
What does the inclusion of files in /etc/sudoers.d affect?
What does the inclusion of files in /etc/sudoers.d affect?
What command configuration would prevent the ec2-user from executing commands as root without a password?
What command configuration would prevent the ec2-user from executing commands as root without a password?
Which statement about the wheel group in this context is correct?
Which statement about the wheel group in this context is correct?
Which command should be used to provide full sudo access to the group group01?
Which command should be used to provide full sudo access to the group group01?
Flashcards
Group
Group
A collection of users who share access to files and resources.
Group ID (GID)
Group ID (GID)
A unique identifier assigned to a group, used by the system for internal management.
/etc/group
/etc/group
A file that stores information about local groups on a system.
Primary Group
Primary Group
Signup and view all the flashcards
User Private Group
User Private Group
Signup and view all the flashcards
Supplementary Group
Supplementary Group
Signup and view all the flashcards
id Command
id Command
Signup and view all the flashcards
What is sudo?
What is sudo?
Signup and view all the flashcards
How can you lock a user account?
How can you lock a user account?
Signup and view all the flashcards
How do you get an interactive root shell?
How do you get an interactive root shell?
Signup and view all the flashcards
What command is used to edit the sudoers file?
What command is used to edit the sudoers file?
Signup and view all the flashcards
What is the sudo configuration file?
What is the sudo configuration file?
Signup and view all the flashcards
What is the wheel group?
What is the wheel group?
Signup and view all the flashcards
How can you avoid interactive login scripts while using sudo?
How can you avoid interactive login scripts while using sudo?
Signup and view all the flashcards
Where are sudo commands logged?
Where are sudo commands logged?
Signup and view all the flashcards
PASS_MAX_DAYS
PASS_MAX_DAYS
Signup and view all the flashcards
PASS_MIN_DAYS
PASS_MIN_DAYS
Signup and view all the flashcards
PASS_WARN_AGE
PASS_WARN_AGE
Signup and view all the flashcards
/etc/login.defs
/etc/login.defs
Signup and view all the flashcards
vim /etc/login.defs
vim /etc/login.defs
Signup and view all the flashcards
What is /etc/sudoers?
What is /etc/sudoers?
Signup and view all the flashcards
What is /etc/sudoers.d directory?
What is /etc/sudoers.d directory?
Signup and view all the flashcards
What is the "sudo" command?
What is the "sudo" command?
Signup and view all the flashcards
What does '%group ALL=(ALL) ALL' mean in /etc/sudoers.d?
What does '%group ALL=(ALL) ALL' mean in /etc/sudoers.d?
Signup and view all the flashcards
What does '%group ALL=(user) /bin/command' mean in /etc/sudoers.d?
What does '%group ALL=(user) /bin/command' mean in /etc/sudoers.d?
Signup and view all the flashcards
What does 'user ALL=(ALL) NOPASSWD: ALL' mean in /etc/sudoers.d?
What does 'user ALL=(ALL) NOPASSWD: ALL' mean in /etc/sudoers.d?
Signup and view all the flashcards
What is Ansible?
What is Ansible?
Signup and view all the flashcards
Why is 'ec2-user ALL=(ALL) NOPASSWD: ALL' commonly used with Amazon EC2 instances?
Why is 'ec2-user ALL=(ALL) NOPASSWD: ALL' commonly used with Amazon EC2 instances?
Signup and view all the flashcards
What are the security implications of using 'NOPASSWD: ALL'?
What are the security implications of using 'NOPASSWD: ALL'?
Signup and view all the flashcards
What does the command sudo su -
do?
What does the command sudo su -
do?
Signup and view all the flashcards
What information does the id
command provide?
What information does the id
command provide?
Signup and view all the flashcards
What does the pwd
command do?
What does the pwd
command do?
Signup and view all the flashcards
What does the HOME
environment variable represent?
What does the HOME
environment variable represent?
Signup and view all the flashcards
What is the purpose of the PATH
environment variable?
What is the purpose of the PATH
environment variable?
Signup and view all the flashcards
Why does sudo
potentially override the PATH
variable?
Why does sudo
potentially override the PATH
variable?
Signup and view all the flashcards
What does the exit
command do?
What does the exit
command do?
Signup and view all the flashcards
What is the functionality of the echo
command?
What is the functionality of the echo
command?
Signup and view all the flashcards
How do you switch to root using su
?
How do you switch to root using su
?
Signup and view all the flashcards
What purpose does the shell prompt serve?
What purpose does the shell prompt serve?
Signup and view all the flashcards
Study Notes
Manage Local Users and Groups
- User accounts provide security boundaries between users and programs
- Users are identified by usernames and unique identification numbers (UIDs)
- Passwords are assigned to prove user authorization
- Processes run as a particular user
- Files have owners, controlling access
- User accounts include superusers (root), system users, and regular users
- Superusers (root) have full system access
User Account Types
- Superuser: Administers the system, has a UID of 0 (root)
- System users: Perform supporting services
- Regular users: Limited access, for daily work
Linux System Security
- User accounts crucial for system security
- Every program/process runs with a user ID (UID) or a user type
- File access control determined by owner and access privileges
- User accounts are essential to control file access
- System uses UIDs to identify users in the database
User Information Files
/etc/passwd
: Stores user information (username, UID, GID, comment, home directory, shell)/etc/shadow
: Stores encrypted passwords (security improvement)
User commands
id
: Displays user information (UID, GID, groups) for the currently logged-in user or a specified userls -l
: Lists file details; includes owner and permissions; for directories, the ownerps
: Lists process information, including the associated UID for the processsu
: Switches to another user accountsudo
: Enables users to run commands with superuser privileges
Group Concepts
- Groups combine users with shared access to system resources
- Group names are used for easier recognition; systems use an ID for each group
/etc/group
: Stores group information (group name, GID, members)
Primary and Supplementary Groups
- Every user has a primary group
- Users can have supplementary group memberships, granted in
/etc/group
- These memberships grant broader access permissions
Gaining Superuser Access
- Systems use the
root
user for elevated privileges sudo
command runs a command with root privileges without having the root passwordsu
command switches to another user account or root account when no user specifiedsu
andsudo
commands are used to switch between users
Understanding Su and Sudo
su
: Direct switch to another user account, often root; may require password.sudo
: Run a command with root privileges; Authenticate with your own password.
Run Commands with Sudo
- When the
root
user account isn't accessible users can use thesudo
command sudo
ensures users have the correct user account permissions.sudo
prevents users from having direct access to root
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.