SSH Security Reinforcement

SSH is a software package that enables secure system administration and file transfers over insecure networks. It is used in nearly every data center and in every large enterprise.

1
2
$ sudo vim /etc/ssh/sshd_config
$ sudo vim /var/log/secure
1
2
3
4
Port 65531    # ssh port to modify the default 22
ListenAddress 192.168.1.X    # ssh allows the IP address of the login
PermitRootLogin no    # root prohibited via ssh
AllowUsers test@192.168.1.*    # allows the user to test the IP 192.168.1. * Client Access Login
1
2
Compression no
Compression delayed
1
2
3
LoginGraceTime 6
MaxAuthTries 3
MaxSessions 6
1
PrintLastLog yes
1
2
ClientAliveInterval 900
ClientAliveCountMax 0
1
2
3
$ sudo ls -l /etc/ssh/*key
$ sudo chmod 0600 /etc/ssh/*key
$ sudo grep -i hostkey /etc/ssh/sshd_config
1
2
$ sudo ls -l /etc/ssh/*pub
$ sudo chmod 0644 /etc/ssh/*pub
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus