#Port 22 #SSH端口,可以修改,默认22
#AddressFamily any #指定sshd应当使用暗中地址族{any(默认)、inet(仅ipv4)、inet6(仅ipv6)}
#ListenAddress 0.0.0.0 #指定监听的IP网络地址,默认监听所有地址
#ListenAddress ::
···省略
# 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
······
#Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h #设置服务器密钥的自动更新时间,
#ServerKeyBits 1024 #定义服务器密钥的位数
······
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV #指定日志消息通过那个日志子系统发送
#LogLevel INFO #设定sshd的日志等级
······
# Authentication:
#LoginGraceTime 2m #限定用户必须在指定的时间内认证登陆,0表示无限制,默认是120秒
#PermitRootLogin yes #是否允许管理员直接登陆
#StrictModes yes #指定是否要求在接受连接请求前对用户主目录和相关的配置文件进行宿主和权限检查
#MaxAuthTries 6 #指定每个连接最大允许的认证次数。默认值是6
#MaxSessions 10 #指定最多的会话连接,默认值是10
······
#RSAAuthentication yes #设置是否允许只有RSA安全验证
PubkeyAuthentication yes #是否允许公钥认证。默认值为”yes”
#AuthorizedKeysFile .ssh/authorized_keys #存放用户连接该主机的公钥存储文件
······
#PasswordAuthentication yes #基于口令的认证
#PermitEmptyPasswords no #是否允许空密码
PasswordAuthentication yes #使用用户名和密码进行验证
······
#Kerberos认证相关
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
······
#GSSAPIAuthentication no #是否允许使用基于 GSSAPI 的用户认证。默认值为no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes #是否在用户退出登录后自动销毁用户凭证缓存。默认值是yes
GSSAPICleanupCredentials yes
·······
#PAM认证模块
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no
UsePAM yes
UsePAM yes
······
#AllowTcpForwarding yes #是否允许TCP转发,默认值为”yes”
#GatewayPorts no
·······
#X11Forwarding no #设置是否允许X11转发
X11Forwarding yes
#X11DisplayOffset 10 #指定X11 转发的第一个可用的显示区(display)数字。默认值是 10
#X11UseLocalhost yes #sshd是否应当将X11转发服务器绑定到本地loopback地址。默认值是”yes”
#PrintMotd yes #设置sshd是否在用户登录的时候显示“/etc/motd”中的信息
#PrintLastLog yes #指定sshd是否在每一次交互式登录时打印最后一位用户的登录时间 默认值是”yes”
#TCPKeepAlive yes #指定系统是否向客户端发送 TCP keepalive 消息。默认值是”yes”
#UseLogin no #是否在交互式会话的登录过程中使用 login默认值是”no”
#UsePrivilegeSeparation yes #是否让sshd通过创建非特权子进程处理接入请求的方法来进行权限分离 默认值是”yes
#PermitUserEnvironment no
#Compression delayed #是否对通信数据进行加密,还是延迟到认证成功之后再对通信数据加密 可用值:yes、no、delayed
#ClientAliveInterval 0 #设置一个以秒记的时长,如果超过这么长时间没有收到客户端的任何数据,
sshd 将通过安全通道向客户端发送一个”alive”消息,并等候应答。
默认值 0 表示不发送”alive”消息
#ClientAliveCountMax 3 #Sshd在未收到任何客户端回应前最多允许发送多少个”alive”消息 默认值是 3
#ShowPatchLevel no
#UseDNS yes #指定在登陆是要不要将IP地址解析,建议设置未no,可以提高连接速度
#PidFile /var/run/sshd.pid #指定在哪个文件中存放SSH守护进程的进程号,默认为 /var/run/sshd.pid文件
#MaxStartups 10 #最大允许保持多少个未认证的连接 默认值是 10
#PermitTunnel no #是否允许 tun 设备转发
·······
# override default of no subsystems #是否允许启动sftp-server
Subsystem sftp /usr/libexec/openssh/sftp-server