Regardless of whether you use Gnome, KDE desktop or you are running a Ubuntu server, you can always easily add new users from the command line.

  1. For example the bellow adduser the command will add a new user named lubos to the Ubuntu 20.04 operating system:
    $ sudo adduser lubos
    Adding user `lubos' ...  
    Adding new group `lubos' (1001) ... 
    Adding new user `lubos' (1001) with group `lubos' ...
    Creating home directory `/home/lubos' ...
    Copying files from `/etc/skel' ...
    Enter new UNIX password: 
    Retype new UNIX password: 
    passwd: password updated successfully
    Changing the user information for lubos
    Enter the new value, or press ENTER for the default
            Full Name []: 
            Room Number []: 
            Work Phone []: 
            Home Phone []: 
            Other []: 
    Is the information correct? [Y/n] y
    

    The user information is optional as the only required input is the new user password.

  2. (optional) Depending on your system and the environment you might need to add a user to a specific group. For example, the following command will add a user lubos to the group cdrom:
    $ sudo usermod -aG cdrom lubos
    
    NOTE
    To list all available system groups enter the cat /etc/group command into your terminal window.
  3. (optional) Lastly, retrieve user and group information to confirm the successful user creation:
    $ id lubos
    uid=1001(lubos) gid=1001(lubos) groups=1001(lubos),24(cdrom)
Was this answer helpful? 0 Users Found This Useful (0 Votes)