Users and Groups Flashcards
Which file allows you delegate sudo privileges to users?
/etc/sudoers
Which editor is recommended to use when editing the sudoers file?
visudo
Why is visudo the recommended editor for editing sudoers?
Verifies syntax texts before committing changes
What is the visudo command to open the sudoers file?
sudo visudo /etc/sudoers
What does the -c flag for visudo do?
Check for file errors
What does the -f flag for visudo do?
Edits the file
What does the -s flag for visudo do?
Checks the file in strict mode
What does the -x flag for visudo do?
Outputs in JSON
What is PolicyKit?
PolicyKit is a Linux component that controls system-wide privileges that allows non-privileged processes to communicate with privileged ones
Example: pkexec mkdir Nick
What is the command to create a new user?
sudo useradd [options] [username]
What does the -c flag for useradd do?
Add a comment to the comment field
What does the -e flag for useradd do?
Sets an expiration date for the user
Example: useradd –e [yyyy][mm][dd] [username]
What does the -s flag for useradd do?
Sets the users default shell
Example: useradd –s /bin/ksh [username]
What does the -D flag for useradd do?
View the default configurations for new users
What is the command for the root user to change or reset the password for another user?
sudo passwd [username]
Newly created users are configured based on which file?
/etc/login.defs
What is the command to change a users expiration date?
sudo chage -E yyyy/mm/dd [user]
What is the command to run a previous command as sudo without typing the command out again?
sudo !!
What is the command to change the maximum days until a user must change their password?
sudo chage -M [days] [user]
What is the command to change the days until a user receives a warning before their password expires?
sudo chage -W [days] [user]
How do you display account aging information of a user?
sudo chage -l [user]
What is the command to change a users username?
sudo usermod -l [username]
How do you change a users username?
sudo usermod -l [newusername] [oldusername]
What is the command to lock a account?
sudo passwd -l [username]