红联Linux门户
Linux帮助

ssh_config

发布时间:2007-04-13 09:00:01来源:红联作者:北窗游客
“/etc/ssh/ssh_config”文件是OpenSSH系统范围的配置文件,允许你通过设置不同的选项来改变客户端程序的运行方式。这个文件的每一行包含“关键词-值”的匹配,其中“关键词”是忽略大小写的。下面列出来的是最重要的关键词,用man命令查看帮助页(ssh (1))可以得到详细的列表。 
  
  编辑“ssh_config”文件(vi /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 ~ 
  
  下面逐行说明上面的选项设置: 
  
  Host * 
  选项“Host”只对能够匹配后面字串的计算机有效。“*”表示所有的计算机。 
  
  ForwardAgent no 
  “ForwardAgent”设置连接是否经过验证代理(如果存在)转发给远程计算机。 
  
  ForwardX11 no 
  “ForwardX11”设置X11连接是否被自动重定向到安全的通道和显示集(DISPLAY set)。 
  
  RhostsAuthentication no 
  “RhostsAuthentication”设置是否使用基于rhosts的安全验证。 
  
  RhostsRSAAuthentication no 
  “RhostsRSAAuthentication”设置是否使用用RSA算法的基于rhosts的安全验证。 
  
  RSAAuthentication yes 
  “RSAAuthentication”设置是否使用RSA算法进行安全验证。 
  
  PasswordAuthentication yes 
  “PasswordAuthentication”设置是否使用口令验证。 
  
  FallBackToRsh no 
  “FallBackToRsh”设置如果用ssh连接出现错误是否自动使用rsh。 
  
  UseRsh no 
  “UseRsh”设置是否在这台计算机上使用“rlogin/rsh”。 
  
  BatchMode no 
  “BatchMode”如果设为“yes”,passphrase/password(交互式输入口令)的提示将被禁止。当不能交互式输入口令的时候,这个选项对脚本文件和批处理任务十分有用。 
  
  CheckHostIP yes 
  “CheckHostIP”设置ssh是否查看连接到服务器的主机的IP地址以防止DNS欺骗。建议设置为“yes”。 
  
  StrictHostKeyChecking no 
  “StrictHostKeyChecking”如果设置成“yes”,ssh就不会自动把计算机的密匙加入“$HOME/.ssh/known_hosts”文件,并且一旦计算机的密匙发生了变化,就拒绝连接。 
  
  IdentityFile ~/.ssh/identity 
文章评论

共有 0 条评论