原文地址:
不管我是使用linux的的SSH还是windows下的putty、SecureCRT还是
AbsoluteTelnet,当我连接到服务器端
后,离开一会或者做点其他的事情,再回到SSH的时候,常常发现客户端自动掉出来了;有的时候甚至跑一个需要时间比较长的JOB的时候,还没跑完就掉出来
了,导致JOB跑了一半,等等。。
所以一直在找解决这个问题的办法,今天在googleReader上找到了一个,如下:
Do you get annoyed when you have a SSH session open,
visit your browser for a while, and then return only to find you were
disconnected? Most home NAT routers are the cause of this. If your
router doesn’t offer an option to not shut off idle connections, you
are probably better off by setting a keep-alive setting.
To do this, just open /etc/ssh/ssh_config on your home (client) computer. Add the following line:
配置代码
- ServerAliveInterval 180
There you have it! Just remember now, if you leave SSH open
accidentally, anyone else can get on it. Remember to close your session
when finished.PS:If you’re using AbsoluteTelnet (for Windows), you can
do this from the Options->Properties->Connection page. There is
an option there to enable keepalives and you can specify the duration
between them.
----------------------------------------------------------
ssh拒绝登陆问题
DEBIAN SARGE服务器,升级到testing后,无法ssh登录了。
经在服务器上检查,SSHD没有问题,帐号没有问题,密码没有问题,服务器安全也没有问题。最终发现是由于默认的安全性得到了提高,导致此问题的。
最后在找到了问题的答案。
或者不使用publickey登录,使用密码登录,要确认PasswordAuthentication该选项设置成 yes。
我的问题在于我的home目录属性发生了变化,即别人也可以写,导致安全检查无法通过。
修复过程:
1、直接到机房登录服务器,修改PasswordAuthentication为yes。
2、重启SSH服务,客户端生成RSA:
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub username@myserver
cd
chmod 700 .ssh
cd /home
chmod 700 myhome
chmod
阅读(6646) | 评论(0) | 转发(1) |