How to Add Adaptable Super User - part 2

Step 1 - Login as root

Login to the system as root

 user@home:~# ssh -i work.key root@work
 Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-34-generic x86_64)
 ...
 root@work:~#

Step 2 - Creating the new account

Now, we will create the new user/account named dingo using adduser command. You will be asked for a password for the account and some details about the user.

 root@work:~# adduser dingo
     Adding user 'dingo' ...
     Adding new group 'dingo' (1000) ...
     Adding new user 'dingo' (1000) with group 'dingo' ...
     Creating home directory '/home/dingo' ...
     Copying files from '/etc/skel' ...
     Enter new UNIX password:
     Retype new UNIX password:
     passwd: password updated successfully
     Changing the user information for dingo
     Enter the new value, or press ENTER for the default
             Full Name []: dingo
             Room Number []:
             Work Phone []:
             Home Phone []:
             Other []:
     Is the information correct? [Y/n] Y

Step 3 - Cloning the login credentials

The following commands will allow the new user can login with the same private key as the root user.

 root@work:~# mkdir /home/dingo/.ssh
 root@work:~# cat .ssh/authorized_keys | tee  /home/dingo/.ssh/authorized_keys
     ssh-rsa AAAA ...

Step 4 - Allow user to gain increased privileges

open /etc/sudoers

 root@work:~# nano /etc/sudoers

Add dingo line after root line in User privilege specification

 # User privilege specification
 root    ALL=(ALL:ALL) ALL
 dingo   ALL=(ALL:ALL) ALL

In the next part we will the the new user.