How to disable root login

How to disable root login

Because of security reasons you should disable root login. WARNING: Make sure that you have a working normal user account before you disable root login. more >>

Contents

Login as root

Login as root.

Edit sshd_config

Open
/etc/ssh/sshd_config

with an editor(e.g. vim)

Set PermitRootLogin to no

Search
PermitRootLogin yes

and replace it with
#PermitRootLogin yes
PermitRootLogin no

Restart SSH daemon

Enter
/etc/init.d/sshd restart

to restart the SSH daemon.

Done

Try to login with root user.

You should get an
access denied now.