Detailed sshd configuration file

#PermitrootLogin=no default root user login is allowed

Prohibit root user login: PermitrootLogin=no

#MaxAuthTries 6 can connect up to 6 failed attempts,

MaxAuthTries 3 Generally setting 3 times is enough

#passwordAuthentication yes Login with password

passwordAuthentication NO Use password to log in

PermitEmptyPasswords no By default, users with empty passwords are not allowed to log in:

StrictHostKeyChecking no This option disables strict checking of the host key without prompting for fingerprint verification.

It's not a good idea to end an idle ssh, keeping the connection open all the time:

ClientAliveInterval 120
ClientAliveCountMax 0

The default unit is seconds ClientAliveInterval 120 For example, if you set 120, it means 2 minutes

ClientAliveCountMax 0

Specifies the time interval for the server to request messages from the client, the default is 0, not sent.

Every minute, sshd greets the ssh client, checks whether it exists, and disconnects if it does not exist.

It means that if it is found that the client does not respond, it will judge a timeout. This parameter sets the number of allowed timeouts to 10;

ClientAliveCountMax setting 2 is 4 minutes

TMOUT=10 No input within ten seconds will exit the current terminal.

Generally configured in /etc/profile

Guess you like

Origin blog.csdn.net/weixin_44815878/article/details/129770162