Users in Linux could be managed using command-line tools or via graphical applications. The most common command-line tools in Linux are adduser and useradd, while most desktop environments and Linux distributions will have a graphical tool which basically is just a frontend to these command-line tools.

All these tools will eventually write related user information in /etc/passwd, /etc/group and /etc/shadow. They'll also create user home directory and populate the home directory with necessary files stored in /etc/skel.

adduser is an interactive command-line tool for user management in Linux. You can run the command at the terminal with just a username as argument and follow along the interactive process to create a user.

Add new user on Linux:

  1. Launch a terminal application.
  2. Run adduser command with a username as argument.
    $ sudo adduser username
  3. Enter password for current user if necessary.
    [sudo] password for user:
  4. adduser will add the user along with other details.
    Adding user `username' ...
    Adding new group `username' (1001) ...
    Adding new user `username' (1001) with group `username' ...
    Creating home directory `/home/username' ...
    Copying files from `/etc/skel' ...
  5. Enter desired password for the user twice.
    New password:
    Retype new password:
    passwd: password updated successfully
  6. Enter some informational values (optional) or just press Enter to keep blank.
    Changing the user information for username
    Enter the new value, or press ENTER for the default
    	Full Name []:
    	Room Number []:
    	Work Phone []:
    	Home Phone []:
    	Other []:
  7. Press Y and Enter to confirm everything is correct and actually create the user.
    Is the information correct? [Y/n] y
Discuss the article:

Share your thoughts, suggest corrections or just say Hi. Login not required.

Share!