In this tutorial you will learn:
- How to add user from command line
- How to add user from graphical user interface
- How to add user to group
- How to retrieve user and group information
Software Requirements and Conventions Used
|Category||Requirements, Conventions or Software Version Used|
|System||Installed or upgraded Ubuntu 20.04 Focal Fossa|
|Other||Privileged access to your Linux system as root or via the |
|Conventions|| # - requires given linux commands to be executed with root privileges either directly as a root user or by use of |
How to add user on Ubuntu 20.04 step by step instructions
Add user from command lineRegardless whether you use Gnome, KDE desktop or you are running Ubuntu server you can always easily add new user from command line.
- For example the bellow
addusercommand will add new use named
lubosto the 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] yThe user information is optional as the only required input is the new user password.
- (optional) Depending on your system and the environment you might need to add user to a specific group. For example the following command will add user
$ sudo usermod -aG cdrom lubos
To list all available system groups enter
cat /etc/groupcommand into your terminal window.
- (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)