Disable root login for ssh server in Kubuntu
February 13th, 2009
If you are a hacker, what is the thing you want to be on a Linux System? Root. You can try to access a ssh server with the root user. There is an option in the ssh server configuration which prevents a remote root login. This does not mean you can not become root, it means no one can directly login as the root user. So if you are logged in as Alice you can simple enter the “su” command to become root.
How we can prevent the remote root login is described below.
![]()
Open the ssh deamon configuration file:
# nano /etc/ssh/sshd_config
Navigate to the “PermitRootLogin” option.
Change “yes” into “no”
Save the config file.
This is not specific to Kubuntu, it works on every OS that has an OpenSSH server installed… (OSX, *BSD and most Linux distributions)
BTW, in nano you can search with ctrl+w, then you won’t have to skip through the whole file until you find the line you need.