How to disable root ssh login?

Create a Username (replace the xxxxxxxxx with your own choices):

  1. # adduser 'xxxxxxxxx'

  2. # passwd 'xxxxxxxxx'

  3. Test the username and password.

  4. Edit # /etc/ssh/sshd_config

  5. Search for PermitRootLogin yes, change to PermitRootLogin no.

  6. Save the file.

  7. Restart ssh service sshd restart OR # /etc/init.d/sshd restart.

2 of 3 people found this helpful.   

Powered by LiveZilla Website Chat Software