免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2855 | 回复: 0
打印 上一主题 下一主题

保持SSH客户端不掉线和ssh拒绝登陆问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-22 16:40 |只看该作者 |倒序浏览

                原文地址:http://iceskysl.1sters.com/?action=show&id=213
不管我是使用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拒绝登陆问题
http://www.cngis.org/bbs/viewtopic.php?f=6&t=8285
DEBIAN SARGE服务器,升级到testing后,无法ssh登录了。
经在服务器上检查,SSHD没有问题,帐号没有问题,密码没有问题,服务器安全也没有问题。最终发现是由于默认的安全性得到了提高,导致此问题的。
最后在
http://www.debian-administration.org/articles/152
找到了问题的答案。
或者不使用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
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/16231/showart_2034538.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP