Users and Groups

Important Files

File LocationExplanation
/etc/passwdConfiguration file for all users
/etc/shadowConfiguration file for all users passwords
/etc/groupConfiguration file for all groups

Managing Users

CommandExplanation
whoamiPrints the current user you’re logged in with
passwdChanges the password of your current user
passwd <USERNAME>Changes the password for the user <USERNAME>
su <USERNAME>Opens a new shell for the user <USERNAME>
useradd <USERNAME>Adds a new user with name <USERNAME>
userdel <USERNAME>Deletes the user <USERNAME>
usermod <USERNAME>Modifies the settings for user <USERNAME>

Managing Groups

CommandExplanation
groupadd <GROUPNAME>Adds a new group with name <GROUPNAME>
groupdel <GROUPNAME>Deletes the group <GROUPNAME>
groupmod <GROUPNAME>Modifies the settings for group <GROUPNAME>

Sudo (substitude user do)

You can add a user to the group “sudo” to give the user sudo privileges: sudo usermod -aG sudo <USERNAME>.

If you want to change the behavior of the “sudo” command enter: sudo visudo