Linux Tutorials - Herong's Tutorial Examples - v5.41, by Herong Yang
"adduser/usermod/userdel" - Commands to Manage Users
This section provides a tutorial example on how to adding a new user, modifying a user setting to join a group, deleting user's login access and removing his home directory.
There 3 primary commands to manage users on Linux systems:
1. "adduser" for adding a new user, "joe", and setting his password.
herong$ sudo adduser joe herong$ sudo passwd joe (set joe's password)
2. "usermod" for modifying user's settings, like adding "joe" to the "dba" group, or changing joe's home directory.
herong$ sudo usermod -aG dba joe herong$ sudo usermod --home /new_home/herong joe
3. "userdel" for removing a user,
herong$ sudo userdel joe (deleting joe's login access) herong$ sudo userdel -r joe (deleting joe's login access and removing his home directory)
Table of Contents