Wednesday, March 12, 2008

How to disable root login through SSH

How to disable root login through SSH.
Before you do this make sure you have created another user in the wheel group.
To disable root login through ssh, edit the following file:
# /etc/ssh/sshd_config
browse to the following line:
PermitRootLogin yes
and change to:
PermitRootLogin no
Save the file and restart ssh.
# /etc/init.d/ssh restart
If you are ssh'd into the server with root when this is done, your connection will fail on the restart of ssh.

No comments: