Allowing root with ssh and keeping terminals from going dead with timeout

Unix

09 Feb 2015

Allowing root with ssh and keeping terminals from going dead with timeout

Preston Garrison 0 Comments

Most modern Unix operating systems disable root login by default.   This is easy to fix just edit sshd_config

nano -w /etc/ssh/sshd_config

 

 

and change the line to the following:

 

PermitRootLogin yes

 

 

Usually its either commented out, or set to no.  Then restart ssh using one of the following methods:

#Debian
/etc/init.d/ssh restart

#Ubuntu
service ssh restart

#FreeBSD
/etc/rc.d/sshd restart

 

 

 

 

Another issue I commonly have with ssh is my sessions getting terminated when they are sitting idle too long, and easy way to fix this is to add the following lines to sshd_config

 

ClientAliveInterval 200
ClientAliveCountMax 200

 

 

Some other settings  to allow ssh keys only, no password login and changing the port so i am less likely to get a bunch of brute force ssh attempts, and even if I did that would not be able to login

 

Port 10022
RSAAuthentication yes
PubkeyAuthentication yes
PasswordAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no

Preston Garrison