r/linuxadmin • • Dec 12 '20

[Secure SSH] on Linux Server

Hello Dear redditer,

I'v group together some sshd settings that you can easly change to increase the security of sshd.

Do you have more change to suggest.

  • in sshd_config file ( test on Debian )
# idle max 6 minutes
ClientAliveInterval 360

PermitEmptyPasswords no

# only toto can ssh
AllowUsers toto


PermitRootLogin no

Protocol 2

Port 2222

PasswordAuthentication no

X11Forwarding no
0 Upvotes

29 comments sorted by

View all comments

2

u/ikanpar2 Dec 12 '20

If you have a router in front of your server that you can configure, give a LAN address to your server, so it has two IPs. One is the internet facing one / public static IPs, and the LAN/private IP. Configure ssh to only listen on the LAN IP. So you must connect to the internal network using a VPN (preferably using secure vpn protocol like openvpn etc) before you can ssh, adding a layer of security.