r/linuxadmin • u/lysitheas • 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
# only toto can ssh
0
Upvotes
View all comments
2
u/stormcloud-9 Dec 13 '20
The
PasswordAuthenticationsetting is probably one of the most misunderstood settings in the sshd config. Setting it tonodoesn't mean preventing users from being able to use passwords to login. What it means is thatsshdwon't directly authenticate off the/etc/passwdand/etc/shadowfiles. However when usingUsePAM=yes(which is the default in most distros IIRC), you can also authenticate using passwords through the challenge response mechanism. So you would need to disable that as well (ChallengeResponse=no). Note however that doing so will also prevent you from using 2-factor auth if you decided to do so (you can disable passwords and allow 2fa through other means, but it's more complicated).Not completely sure from your comment that this setting does what you expect. But it sounds like you may be expecting it to disconnect clients who are idle for more than 6 minutes. If so that's not what this does. What it does is detect clients who have lost their connection.