3

ssh登录时间长的解决方法

 3 years ago
source link: https://www.liurongxing.com/how-to-solve-sshd-to-log-long-time.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ssh登录时间长的解决方法

作者: JavasBoy 分类: Linux 发布时间: 2012-02-29 12:05 ė 18,511 views 6 没有评论

ssh远程登录到VM虚拟机中登录时间太长,要等待很久才会出现输入密码的提示,今天终于有时间google了一下,纪录一下一般的解决方法:

1.使用了dns反查,这样的话当ssh某个IP时,系统会试图通过DNS反查相对应的域名,如果DNS中没有这个IP的域名解析,则会等到DNS查询超时才会进行下一步,消耗很长时间。修改方式:

vim /etc/ssh/sshd_config
# 增加一行记录:
UseDNS no

默认情况下会有一行被注释掉的记录#UseDNS yes,虽然这条记录被注释掉了,但ssh缺省情况下UseDNS的值是yes,所以要显式的指定该值为no。

2. 这种情况在本地主机或远程主机启动图形的情况下比较明显,该参数似乎是在做图形方面的认证,具体功能还不清楚,但修改以后可以明显提高ssh远程登录速度。

vim /etc/ssh/sshd_config
# 修改GSSAPIAuthentication参数为 no,默认是yes
GSSAPIAuthentication no
# 重新启动ssh服务
service sshd restart

ssh –vvv [email protected]

-vvv的参数可以查看ssh登录的过程,看看当前进行到了哪一步。

发表评论 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

评论

显示名称 *

电子邮箱地址 *

网站网址


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK