HOW TO : Turn off Root Login to help harden a server
For Server:
centos 6.5
cPanel/WHM Control Panel
OpenVZ
1. Login to WHM (Web Host Manager)
WHM >> Security Center >> Manage Wheel Group Users
2. Add [MainUsernameHere] to the wheel group
The 'wheel group' controls which users can 'su' into SSH
*MainUsernameHere is the name you want to use to log in via SSH. From this username, you'll will be able to su into to the server
3. Log in via SSH and run the following commands:
pico /etc/ssh/sshd_config
Add (or change) this command near the top:
PermitRootLogin no
Save.
4. Restart sshd
/etc/init.d/sshd restart
5. Restart Apache
WHM >> Restart Services >> HTTP Server (Apache)