Linux: openssh: ssh登陆慢与 getnameinfo的关系

参考

https://www.man7.org/linux/man-pages/man3/getnameinfo.3.html
https://www.man7.org/linux/man-pages/man5/resolv.conf.5.html

过程

当sshd的启动配置里有配置: useDNS yes(或者使用默认值,yes)
这个配置的作用是:让sshd根据远端的IP信息做DNS查询,做反向校验。默认值是 “yes”.
If this option is set to no then only addresses and not host names may be used in ~/.ssh/authorized_keys from and sshd_config Match Host directives.

而且在/etc/resolv.conf 里配置几个不通的DNS 服务IP。

就可以

模拟出登陆慢的情况。

解决方法

useDNS no
设置正确的dns服务。

频度

如果出现这种问题可能会比较迷惑,怎么会出现这种情况呢。从网上看好多这种DNS导致的问题。

猜你喜欢

转载自blog.csdn.net/qq_36428903/article/details/130407795
今日推荐