1、监听端口及IP设置
Port 22
AddressFamily any
ListenAddress 0.0.0.0
ListenAddress ::
Protocol 2
/*
Port:sshd服务端口,预设22,也可以开放多个端口
AddressFamily:使用地址族,any(默认)、inet(仅IPv4)、inet6(仅IPv6)
ListenAddress:设置监听的地址
Protocol:SSH协议版本
*/
2、私钥存放位置
# HostKey for protocol version 1
HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
/*
主机私钥存放位置
*/
3、秘钥过期时间和大小
KeyRegenerationInterval 1h
ServerKeyBits 1024
/*
对于SSH-1协议中秘钥的过期时间和大小
*/
4、日志相关设置
# Logging
SyslogFacility AUTH
SyslogFacility AUTHPRIV
LogLevel INFO
/*
SyslogFacility:日志系统选择
LogLevel:日志等级选择
*/
5、权限限制设置
# Authentication:
LoginGraceTime 2m
PermitRootLogin yes
StrictModes yes
MaxAuthTries 6 #MaxAuthTries,指定每个连接最大允许的认证次数。默认值是6
MaxSessions 10
/*
LoginGraceTime:限制认证时限
PermitRootLogin:允许ROOT账户登录,prohibit-password禁止root登录,同no
StrictModes:检查用户主目录和相关的配置文件
MaxAuthTries:最大认证次数

2万+

被折叠的 条评论
为什么被折叠?



