Friday 31 December 2010

Disable Root SSH Login on Debian

Before we begin, you should make sure that you have a regular user account and that you can su or sudo to root from it. So  do these first:


adduser usrer1
assign a passwd to user1. and then add it to sudoers. But first need to install sudo:


apt-get install sudo
add this line inside to 


        nano /etc/sudoers


user1  ALL=(ALL) ALL


Open the file up while logged on as root.
nano /etc/ssh/sshd_config
Find this section in the file, containing the line with “PermitRootLogin” in it.
#LoginGraceTime 2m
#PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
Make the line look like this to disable logging in through ssh as root.

PermitRootLogin no
Now you’ll need to restart the sshd service:

/etc/init.d/ssh restart
Now nobody can brute force your root login, at least.

Source: How-to Geek

No comments:

Post a Comment