How to disable root ssh login?
Create a Username (replace the xxxxxxxxx with your own choices):
-
# adduser 'xxxxxxxxx'
-
# passwd 'xxxxxxxxx'
- Test the username and password.
- Edit
# /etc/ssh/sshd_config
- Search for
PermitRootLogin yes
, change toPermitRootLogin no
. - Save the file.
- Restart ssh
service sshd restart
OR# /etc/init.d/sshd restart
.