问题:ssh Write failed: Broken pipe 连接自动断开
解决:
vi /etc/ssh/sshd_config
ClientAliveInterval 60
ClientAliveCountMax 10
重启进程:
/etc/init.d/sshd reload
问题:ssh 连接太慢
解决:
去掉认证:
GSSAPIAuthentication no
去掉DNS:
UseDNS no
永久解决办法:
1,打开编辑ssh配置文件:vim /etc/ssh/ssh_config
2,在文件中查找 “GSSAPIAuthentication yes” 这一行,修改“yes” 为 “no”
3,保存退出
补充:如果只是想针对某个用户来禁用GSSAPIAuthentication,只需要在用户目录下的 .ssh 目录中建立一个config文件,在文件中添加行“GSSAPIAuthentication no”即可。
经过修改,ssh登录开发机已经是秒登,如果有人ssh登录慢,可以试试这个简单的办法。
关于GSSAPI:
GSSAPI是Generic Security Services Application Program Interface的缩写,译为通用安全服务应用程序接口,是ITEF的一个标准,这将允许不同的安全算法使用一个标准化的API来为网络产品提供加密认证。OPENssh 使用这个API并且底层的kerberos 5协议代码提供除了ssh_keys 的另一种ssh认证方式。
问题:
ssh连接远程服务器,报警信息 Address X.X.X.X maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT! 如下:
[root@upgirl ~]# ssh [email protected]
Address 192.168.0.203 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
[email protected]'s password:
Last login: Thu Feb 21 03:01:49 2013 from desktop100.example.com
解决方法:修改本机ssh_config文件
[root@h3 ~]# vim /etc/ssh/ssh_config
GSSAPIAuthentication no
测试OK:
[root@upgirl ~]# ssh [email protected]
[email protected]'s password:
Last login: Thu Feb 21 03:55:05 2013 from 192.168.0.11
问题:
SSH连接的时候Host key verification failed.
SSH连接的时候Host key verification failed.
[root@cache001 swftools-0.9.0]# ssh 192.168.1.90
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
05:25:84:ea:dd:92:8d:80:ce:ad:5b:79:58:fe:c9:42.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:10
RSA host key for 192.168.1.90 has changed and you have requested strict checking.
Host key verification failed.
解决方法:
vi ~/.ssh/known_hosts
进入此目录,删除192.168.1.90的相关rsa的信息即可.
或者删除这个文件
cd ~/.ssh/
rm known_hosts