The problem with logging in as root is that you can execute any command - even a command that could accidentally break your server. For this reason and others, we recommend creating another user account and using that at all times. After you log in with the new account, you’ll still be able to execute superuser commands with the sudo command.

Here’s how to add a new user on Debian:

Debian

Open a terminal window and log in to your server via SSH.
Create the user by entering the following command. Replace exampleuser with your desired username:
adduser exampleuser
Add the user to the administer the system (admin) group by entering the following command. Replace exampleuser with your username:
usermod -a -G sudo exampleuser
Log out of your server as the root user by entering the following command:
logout
Log in to your server as the new user by entering the following command. Replace exampleuser with your username, and the example IP address with your server’s IP address:
ssh exampleuser@122.222.22.22

 

Was this answer helpful? 0 Users Found This Useful (21 Votes)