ssh登录缓慢,使用ssh -v登录后,显示在 “pledge: network” 处卡顿:


当登录一台服务器时,每次输入密码之后都要等很久才会得到命令提示符,尝试修改了sshd_config中的UseDNS no,但效果依然不好。

ssh -v 192.168.12.43

This is probably an issue with D-Bus and systemd. If the dbus service is restarted for some reason, you will also need to restart systemd-logind.
You can check if this is the issue by opening the ssh daemon log (on Ubuntu it should be /var/log/auth.log) and check if it has these lines:
注:CentOS 下查看 

 
cat /var/log/secure

sshd[2721]: pam_systemd(sshd:session): Failed to create session: Connection timed out
如果找到以上信息,则在服务端执行:

systemctl restart systemd-logind
 
完美解决!!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM