# This is the sshd server system-wide configuration file. See # sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options override the # default value.
# If you want to change the port on a SELinux system, you have to tell # SELinux about this change. # semanage port -a -t ssh_port_t -p tcp #PORTNUMBER #SELinux配置SSH端口 # #Port 22 #监听的服务器端口 #AddressFamily any #any表示同时监听iPv4和iPv6地址 #ListenAddress 0.0.0.0 #监听iPv4地址 #ListenAddress :: #监听iPv6地址
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 # but this is overridden so installations will only check .ssh/authorized_keys AuthorizedKeysFile .ssh/authorized_keys #公钥验证文件路径
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # HostbasedAuthentication #指定服务器在使用 ~/.shosts ~/.rhosts /etc/hosts.equiv进行远程主机名匹配时,是否进行反向域名查询 #IgnoreUserKnownHosts no #是否在 RhostsRSAAuthentication 或 HostbasedAuthentication 过程中忽略用户的 ~/.ssh/known_hosts 文件 # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes #是否在 RhostsRSAAuthentication 或 HostbasedAuthentication 过程中忽略 .rhosts 和 .shosts 文件
# To disable tunneled clear text passwords, change to no here! #PasswordAuthentication yes #是否启用密码登录验证,建议使用秘钥登录 #PermitEmptyPasswords no #是否允许空密码
# Change to no to disable s/key passwords #ChallengeResponseAuthentication yes ChallengeResponseAuthentication no #是否允许质疑-应答(challenge-response)认证
# GSSAPI options GSSAPIAuthentication yes #是否允许基于GSSAPI的用户认证 GSSAPICleanupCredentials no #是否在用户退出登录后自动销毁用户凭证缓存 #GSSAPIStrictAcceptorCheck yes #GSSAPIKeyExchange no #GSSAPIEnablek5users no
# 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'. # WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several # problems. UsePAM yes #是否通过PAM验证
# no default banner path #Banner none #将这个指令指定的文件中的内容在用户进行认证前显示给远程用户,默认什么内容也不显示,"none"表示禁用这个特性
# Accept locale-related environment variables AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE AcceptEnv XMODIFIERS #override default of no subsystems Subsystem sftp /usr/libexec/openssh/sftp-server #配置一个外部子系统sftp及其路径
# Example of overriding settings on a per-user basis #Match User anoncvs #引入一个条件块。块的结尾标志是另一个 Match 指令或者文件结尾 # X11Forwarding no # AllowTcpForwarding no # PermitTTY no # ForceCommand cvs server