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.
Most Popular Articles
Setup Teamspeak 3 Server on Linux (CentOS)
If you run a gaming community, a Teamspeak 3 server is probably a popular choice for you to have...
Change MySQL Data Directory in Linux
There's many reasons that you might want to change the directory that your MySQL data is stored...
Mojang Authentication Down (OpenJDK - Ubuntu/Debian)
If you're using Linux Ubuntu / Debian with Java OpenJDK (Spigot, Craftbukkit, Forge, etc.) and...
Force HTTPS / SSL for cPanel domain
Add the following to the top of the .htaccess file in your websites document root to force...
Resize KVM VPS Partition with GParted ISO
Resize a Linux OS partition to use extra drive space allocated after an upgrade. A few notes:1)...