Step 5: Create another User
Table of Contents
Another method of logging in without the root password is to create a user with restricted rights.
The user could be a part of SUDO group
Or, you can
su root
when you need root access
Create Non-privileged User
You can do most of your work without logging in as root. At times you will still need to use root privileges.
This text is from OVH’s Securing a VPS guide.
Creating a user with restricted rights, and intervening in the system with root rights.
You can create a new user with the following command:
adduser CustomUserName
Then fill in the information requested by the system (password, name, etc.). This user will be allowed to log in to your system via SSH, with the password specified when the account was created.
Once you are logged in to your system with these credentials, if you want to perform operations that require root rights, simply type the following command:
su root
You must then enter the password associated with the root user to validate the operation.
Add a Limited User account
Another option is to add a limited user account.
The process is simple for Ubuntu.
Add a user
adduser CustomUserName
Then, add the user to the
sudo
group.Linux 101: Introduction to sudo explains about sudo
adduser CustomUserName sudo
This user can use elevated privileges by prefixing every command with
sudo
. The user will have to enter their password during the sessions.
Note
It is recommended that you use a password-less login for all users. Instead, create SSH keys for the logins.