SSH disable root login on server

Asked by Andree on 2012-02-28

Hi,

i would like to disable the root login via ssh on my server.

I added "PermitRootLogin no" (without "") to /etc/ssh/ssh_config and then did a /etc/init.d/ssh restart but this doesn't work.

Does anyone know what's wrong?

My server is a Ubuntu 10.04. Since it is running in a shared environment the server was configured as a LAMP server and also ssh was already configured.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openssh Edit question
Assignee:
No assignee Edit question
Solved by:
Andree
Solved:
2012-03-03
Last query:
2012-03-03
Last reply:
2012-02-28

try:

sudo service ssh stop; sudo service ssh start

or alternatively, reboot the system.

hmm that didn't work. I did a reboot but i still can log in as root via ssh.

The root account should be disabled, so you should fail authentication anyway

my fault! was trying to add PermitRootLogin sshd_conf and not to ssh_conf.