Disabling root SSH logins and adding an additional sudo user is a good security measure for any linux system.

First we need to disable root login for the SSH server, edit the following file
/etc/ssh/sshd_config

Find the following section:
PermitRootLogin yes

Change it to:
PermitRootLogin no

Save the file.

Next we need to add our additional user, name it whatever you want:
adduser myusername

Then set a password for the user:
passwd myusername

Now we need to edit the following file to add the new user to the wheel group:
/etc/group

Find the following line:
wheel:x:10:root

Change it to the following with your new user added:
wheel:x:10:root,myusername

Save the file and restart the SSH service:
service sshd restart

Now if you try to connect to your server via SSH as root it should give you an incorrect password error. You can login with the new user you've just made now, and run the "su -" command as the new user to run as root.

Was this answer helpful? 33 Users Found This Useful (733 Votes)