查看ssh_config
cat /etc/ssh/ssh_config
# Site-wide defaults for various options
Host *
ForwardAgent no
ForwardX11 no
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes
PasswordAuthentication yes
FallBackToRsh no
UseRsh no
BatchMode no
CheckHostIP yes
StrictHostKeyChecking no
IdentityFile ~/.ssh/identity
Port 22
Cipher blowfish
EscapeChar ~
下面对上述选项参数逐进行解释:
# Site-wide defaults for various options 带“#”表示该句为注释不起作用
# Site-wide defaults for various options 意在说明下面选项均为系统初始默认的选项
# Site-wide defaults for various options 说明此为系统默认的初始化设置
Host * "Host"只对匹配后面字串的计算机有效
Host * “*”表示所有的计算机
Host * 下面缩进的选项都适用于该设置
Host * 指定某计算机替换*号使下面选项只针对该算机器生效
ForwardAgent no 设置连接是否经过验证代理(如果存在)转发给远程计算机
ForwardX11 no 设置X11连接是否被自动重定向到安全的通道和显示集(DISPLAY set)
RhostsAuthentication no 设置是否使用基于rhosts的安全验证
RhostsRSAAuthentication no 设置是否使用用RSA算法的基于rhosts的安全验证
RSAAuthentication yes 设置是否使用RSA算法进行安全验证
PasswordAuthentication yes 设置是否使用口令验证
FallBackToRsh no 设置如果用ssh连接出现错误是否自动使用rsh,由于rsh并不安全,所以此选项应当设置为"no"
UseRsh no 设置是否在这台计算机上使用"rlogin/rsh",原因同上,设为"no"
BatchMode no 批处理模式
BatchMode no 一般设为"no";
BatchMode no 如果设为"yes",交互式输入口令的提示将被禁止,这个选项对脚本文件和批处理任务十分有用
CheckHostIP yes 设置ssh是否查看连接到服务器的主机的IP地址以防止DNS欺骗
CheckHostIP yes 建议设置为"yes"
StrictHostKeyChecking no 如果设为"yes",ssh将不会自动把计算机的密匙加入"$HOME/.ssh/known_hosts"文件,且一旦计算机的密匙发生了变化,就拒绝连接
IdentityFile ~/.ssh/identity 设置读取用户的RSA安全验证标识
Port 22 设置连接到远程主机的端口,ssh默认端口为22
Cipher blowfish 设置加密用的密钥,blowfish可以自己随意设置
EscapeChar ~ 设置escape字符