A question can only have one accepted answer. Are you sure you want to replace the current answer with this one?
You previously marked this answer as accepted. Are you sure you want to unaccept it?
How can I disable SSH login for a root user? (I am the account owner)
Add a line to your ssh config file: /etc/ssh/sshd_config
Add comments here to get more clarity or context around a question. To answer a question, use the “Answer” field below.
You can disable root SSH login by editing /etc/ssh/sshd_config, setting PermitRootLogin to no, and then restarting ssh:
sudo service ssh restart
Thanks but I need to disable SSH for ONE root user, not all.
There is only one root user a typical linux system. If you want to disable SSH access for a specific user, add the following line to sshd_config and restart SSH:
DenyUsers user1 user2 ...