Ubuntu 21.04
Sponsored Link

Initial Settings : Add User Accounts
2021/04/28
 
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 [hirsute] user.
ubuntu@localhost:~$
sudo adduser hirsute

[sudo] password for ubuntu:  # input self password
Adding user `hirsute' ...
Adding new group `hirsute' (1001) ...
Adding new user `hirsute' (1001) with group `hirsute' ...
Creating home directory `/home/hirsute' ...
Copying files from `/etc/skel' ...
New password:           # set user password
Retype new password:    # confirm
passwd: password updated successfully
Changing the user information for hirsute
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
ubuntu@localhost:~$
[2] If you'd like to give privileges to a new user, Configure like follows.
ubuntu@localhost:~$
sudo
usermod -G sudo hirsute

ubuntu@localhost:~$
su - hirsute

Password:
# try to run a command which requires root privilege

hirsute@localhost:~$
sudo ls -l /root

[sudo] password for hirsute:    
# input self password

total 4
drwxr-xr-x 3 root root 4096 Apr 27 02:02 snap
[3] If you'd like to remove user accounts, Configure like follows.
# remove a user [hirsute] (only removed user account)

ubuntu@localhost:~$ sudo
deluser hirsute
# remove a user [hirsute] (removed user account and his home directory)

ubuntu@localhost:~$ sudo
deluser hirsute --remove-home
Matched Content