Understanding Linux users and groups
Manage user accounts
Manage group accounts
Creating user account at the command line
Modifying user accounts
-c "bablu kumar" => comment
-s "/bin/ksh" => setting a shell
By default, a user is a member of its own group.
*) => indicates they can't login because they are service accounts.
!!) => indicates that no password is set yet.
To make sure, all new members get, for example a company policy, in their home directory. We can add that to the
usermod -L bk => Locks the bk's account
Looking into the
/etc/shadow file indicates the account has been locked.
usermod -U bk
If you just want to delete the user;
userdel username In this case, the user's home directory remains intact.
Deleting a user including her/his home directory:
userdel -r usernameRemember to take a backup before doing it though.
Creating groups at the command line
Creating groups in the GUI
-a => append to
-G => a supplemental group
-g => switch a primary group
You can also check the group information in
usermod -aG wheel bkumar # Now bkumar can use sudo do tasks that require priviledges on Red Hat systemsusermod -aG admin bkumar # used in Ubuntu (Debian) systems for the same purposes.
su - it logs into the root account if you have the root's password
sudo -i it also does the same but once you are in the wheel group, you need to type in your password rather than the root's password which is a safer way.
sudo visudo contains the configuration file for the sudo management.
/etc/sudoers.d/ contains some snap in files that lets you add these configurations as snap-ins.
Delete the group: