记一次ssh连接慢

2020-03-28日机房搬迁完后,发现有一台60服务器ssh连接特别慢,但是其他服务器正常;

下面是解决过程:

  • vim /etc/ssh/sshd_config       (编辑配置文件)
  • 查找FSSAPIAuthentication  赋值为no
  • 查找UseDNS  赋值为no(该项默认是不启动的,要把前面的#删除)
  • 保存退出
  • systemctl restart sshd (重启sshd)

结果发现重启sshd时发现

Authorization not available. Check if polkit service is running or see debug message for more information.

 

  • 应该不是sshd_config配置的原因,还是将sshd_config改回来,重新保存;

然后用 ssh -v root@ip地址 -p 22 查看具体过程时,输入密码后发现在pledge:network停了好久

 

看下 cat /var/log/secure  发现如下failed

Failed to create session:Failed to activate service 'org.freedesktop.login1':time out

 

然后结合重启sshd失败的原因,重新安装polkit包

yum -y reinstall polkit

重新安装后

systemctl daemon-reexec

在启动登录服务

systemctl start systemd-logind

 

问题解决

猜你喜欢

转载自www.cnblogs.com/minxl/p/12607552.html