
查看ssh_config
cat /etc/ssh/ssh_config
# Site-wide defaults for various optionsHost *ForwardAgent noForwardX11 noRhostsAuthentication noRhostsRSAAuthentication noRSAAuthentication yesPasswordAuthentication yesFallBackToRsh noUseRsh noBatchMode noCheckHostIP yesStrictHostKeyChecking noIdentityFile ~/.ssh/identityPort 22Cipher blowfishEscapeChar ~
下面对上述选项参数逐进行解释:
# 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默认端口为22Cipher blowfish 设置加密用的密钥,blowfish可以自己随意设置EscapeChar ~ 设置escape字符