安全 Shell 中的关键字
下表列出了关键字及其缺省值(如果有)。这些关键字按字母顺序排列。应用于客户机的关键字位于 ssh_config 文件中。应用于服务器的关键字位于 sshd_config 文件中。一些关键字在两个文件中均有设置。已标记运行 v1 协议的安全 Shell 服务器关键字。
表 2-1 安全 Shell 配置文件中的关键字
|
|
|
AllowGroups
|
|
服务器
|
AllowTcpForwarding
|
yes
|
服务器
|
AllowUsers
|
|
服务器
|
AuthorizedKeysFile
|
~/.ssh/authorized_keys
|
服务器
|
Banner
|
/etc/issue
|
服务器
|
Batchmode
|
no
|
客户机
|
BindAddress
|
|
客户机
|
|
yes
|
客户机
|
ChrootDirectory
|
no
|
服务器
|
Cipher
|
|
客户机
|
Ciphers
|
aes128-ctr、aes128-cbc、3des-cbc、blowfish-cbc、arcfour
|
两者
|
ClearAllForwardings
|
no
|
客户机
|
ClientAliveCountMax
|
3
|
服务器
|
ClientAliveInterval
|
0
|
服务器
|
Compression
|
no
|
两者
|
CompressionLevel
|
|
客户机
|
ConnectionAttempts
|
1
|
客户机
|
ConnectTimeout
|
系统 TCP 超时
|
客户机
|
DenyGroups
|
|
服务器
|
DenyUsers
|
|
服务器
|
DisableBanner
|
no
|
客户机
|
DynamicForward
|
|
客户机
|
EscapeChar
|
~
|
客户机
|
FallBackToRsh
|
no
|
客户机
|
ForwardAgent
|
no
|
客户机
|
|
no
|
客户机
|
|
yes
|
客户机
|
GatewayPorts
|
no
|
两者
|
GlobalKnownHostsFile
|
/etc/ssh/ssh_known_hosts
|
客户机
|
GSSAPIAuthentication
|
yes
|
两者
|
GSSAPIDelegateCredentials
|
no
|
客户机
|
GSSAPIKeyExchange
|
yes
|
两者
|
GSSAPIStoreDelegateCredentials
|
yes
|
服务器
|
HashKnownHosts
|
no
|
客户机
|
Host
|
|
客户机
|
HostbasedAuthentication
|
no
|
两者
|
HostbasedUsesNameFromPacketOnly
|
no
|
服务器
|
HostKey (v1)
|
/etc/ssh/ssh_host_key
|
服务器
|
HostKey (v2)
|
/etc/ssh/host_rsa_key、 /etc/ssh/host_dsa_key
|
服务器
|
HostKeyAlgorithms
|
ssh-rsa、ssh-dss
|
客户机
|
HostKeyAlias
|
|
客户机
|
HostName
|
|
客户机
|
IdentityFile
|
~/.ssh/id_dsa、~/.ssh/id_rsa
|
客户机
|
IgnoreIfUnknown
|
|
客户机
|
IgnoreRhosts
|
yes
|
服务器
|
IgnoreUserKnownHosts
|
yes
|
服务器
|
KbdInteractiveAuthentication
|
yes
|
两者
|
KeepAlive
|
yes
|
两者
|
KeyRegenerationInterval
|
3600(秒)
|
服务器
|
ListenAddress
|
|
服务器
|
LocalForward
|
|
客户机
|
LoginGraceTime
|
120(秒)
|
服务器
|
LogLevel
|
info
|
两者
|
LookupClientHostnames
|
yes
|
服务器
|
MACs
|
hmac-sha1-*、 hmac-md5-* 和 hmac-sha2-* 算法。
|
两者
|
Match
|
|
服务器
|
MaxStartups
|
10:30:60
|
服务器
|
NoHostAuthenticationForLocalHost
|
no
|
客户机
|
NumberOfPasswordPrompts
|
3
|
客户机
|
PAMServiceName
|
|
服务器
|
PAMServicePrefix
|
|
服务器
|
PasswordAuthentication
|
yes
|
两者
|
PermitEmptyPasswords
|
no
|
服务器
|
PermitRootLogin
|
no
|
服务器
|
PermitUserEnvironment
|
no
|
服务器
|
PidFile
|
/system/volatile/sshd.pid
|
服务器
|
Port
|
22
|
两者
|
PreferredAuthentications
|
hostbased、publickey、 keyboard-interactive、 passwor
|
客户机
|
PreUserauthHook
|
|
服务器
|
PrintLastLog
|
yes
|
服务器
|
PrintMotd
|
no
|
服务器
|
Protocol
|
2,1
|
两者
|
ProxyCommand
|
|
客户机
|
PubkeyAuthentication
|
yes
|
两者
|
RekeyLimit
|
1G 至 4G
|
客户机
|
RemoteForward
|
|
客户机
|
RhostsAuthentication
|
no
|
服务器, v1
|
RhostsRSAAuthentication
|
no
|
服务器, v1
|
RSAAuthentication
|
no
|
服务器, v1
|
ServerAliveCountMax
|
3
|
客户机
|
ServerAliveInterval
|
0
|
客户机
|
ServerKeyBits
|
512 至 768
|
服务器, v1
|
StrictHostKeyChecking
|
ask
|
客户机
|
StrictModes
|
yes
|
服务器
|
Subsystem
|
sftp /usr/lib/ssh/sftp-server
|
服务器
|
SyslogFacility
|
auth
|
服务器
|
UseFIPS140
|
no
|
两者
|
UseOpenSSLEngine
|
yes
|
两者
|
UsePrivilegedPort
|
no
|
两者
|
User
|
|
客户机
|
UserKnownHostsFile
|
~/.ssh/known_hosts
|
客户机
|
UseRsh
|
no
|
客户机
|
VerifyReverseMapping
|
no
|
服务器
|
X11DisplayOffset
|
10
|
服务器
|
X11Forwarding
|
yes
|
服务器
|
X11UseLocalHost
|
yes
|
服务器
|
|
/usr/bin/xauth
|
两者
|
|