Initial Settings : Add User Accounts
After installing Ubuntu System, there is only a user you configured during installation except System Accounts and he is an administrative user.If you’d like to add more common user accounts on System, Configure like follows. [1]For example, Add a [jammy] user.
[email protected]:~$ sudo adduser jammy
[sudo] password for ubuntu: # input self password Adding user `jammy' ... Adding new group `jammy' (1001) ... Adding new user `jammy' (1001) with group `jammy' ... Creating home directory `/home/jammy' ... Copying files from `/etc/skel' ... New password: # set user password Retype new password: # confirm passwd: password updated successfully Changing the user information for jammy Enter the new value, or press ENTER for the default Full Name []: # input user info (OK with empty all if you do not need) Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y
[2] If you’d like to give privileges to a new user, Configure like follows.
[email protected]:~$ sudo usermod -aG sudo jammy [email protected]:~$ su - jammy Password: # try to run a command which requires root privilege [email protected]:~$ sudo ls -l /root [sudo] password for jammy: # input self password
total 4 drwx------ 3 root root 4096 Apr 22 13:31 snap
[3] If you’d like to remove user accounts, Configure like follows.
# remove a user [jammy] (only removed user account)
[email protected]:~$ sudo deluser jammy # remove a user [jammy] (removed user account and his home directory)
[email protected]:~$ sudo deluser jammy –remove-home