I want to enable root login at the console only, and disable root login via SSH.

However other users can still SSH to the server (Ubuntu 14) and even sudo if there part of the sudoers group.

I have the sudo bit sorted, just not sure how to restrict root to console login only.

Many thanks

2 Answers 2


In /etc/ssh/sshd_config, set PermitRootLogin to

 PermitRootLogin no

and restart the sshd daemon:

service ssh restart

Add this to /etc/ssh/sshd_config

PermitRootLogin no

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.