How do I disable ssh access for root?

To disable this, you must have at least one non-privileged user
that is allowed to login through SSH. If no such user exists, you will
have to create it.



Whichever user you use, you should then edit /etc/group and add that
user to the ‘wheel’ group. Adding them to wheel will allow that user to
su to root when they login.



From there, you would edit /etc/ssh/sshd_config and either uncomment, or add the following:



PermitRootLogin no



and then restart ssh.



It is advisable to stay logged in as root, in case there are any issues
with the non-privileged users access. Open up another SSH session and
log in with the non-privileged user and verify that you can use su to
assume root privileges.

Your rating: None