Best practices for using SSH
1) only use SSH Protocol 2
2) Limit users SSh access
Allowusers Root Vivek Jerry
White List
Denyuser saroj Anjali Foo
Blacklist
3) Configure idle Log out timeout Interval configuration idle timeout long.
Clientalivecountmax 300
Clientaliveinterval 0
4) Firwall SSH Port # 22
To set the SSH service security access policy using iptables
5) Change SSH port and Limit IP binding
Port 300
Listaddress 192.168.1.5
ListenAddress 202.54.1.5
Do not use the default 22 port
6) Use strong SSH passwords and passphrase
GENPASSWD () {
Local 1=$1
["] = =" "]&& 1=20
TR-DC A-za-z0-9_</dev/urandom | Head-c ${1} | Xargs
}
Use a password that is sufficiently long enough to be complex and regularly replaced.
7) Use public key Based authentication
Use public key authentication.
8) Disable Empty password
9) Thwart SSH crakers (Brute Force attack)
Google:ssh Best Practice
Rate-limit Incoming Port # COnnections
Limit the frequency of SSH access
One) Use Log analyzer
Log good logs, often do log analysis.
Best practices for using SSH