Home > 开源软件 > ssh 建立连接很慢的问题

ssh 建立连接很慢的问题

如果发现 ssh 连接主机很慢,一般来说并不是公钥认证的过程耗时,最有可能的原因是 sshd 试图对 remote client address 做一次 DNS 反解析。

可以修改 /etc/ssh/sshd_config 文件,在文件最后加上一行(如果已存在 UseDNS 这个选择则修改)

UseDNS no

然后重启 ssh 即可

/etc/init.d/ssh restart

Categories: 开源软件 Tags:
  1. No comments yet.
  1. No trackbacks yet.
Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).