CentOS7.2 ssh 登录太慢,经排查是一个 systemd-logind 服务没起来,但是 restart 报错,各位遇到过吗

2019-10-08 15:46:41 +08:00
 opsonly

Oct 8 15:43:27 dbus[1049]: [system] Failed to activate service 'org.freedesktop.systemd1': timed out Oct 8 15:43:27 systemd-logind: Failed to enable subscription: Connection timed out Oct 8 15:43:27 dbus-daemon: dbus[1049]: [system] Failed to activate service 'org.freedesktop.systemd1': timed out Oct 8 15:43:27 systemd-logind: Failed to fully start up daemon: Connection timed out Oct 8 15:43:27 systemd: systemd-logind.service: main process exited, code=exited, sta

9800 次点击
所在节点    Linux
15 条回复
shakespark
2019-10-08 16:01:53 +08:00
一般来说,ssh 登录慢是因为配置里的 dns 解析没设置为 off
shyy06
2019-10-08 16:30:47 +08:00
@shakespark #1 同意。
qwerthhusn
2019-10-08 16:39:36 +08:00
UseDNS=no
wodexiaogou
2019-10-08 17:06:48 +08:00
可以用 journalctl -f 再重启看看,报错会详细些
opsonly
2019-10-08 17:53:38 +08:00
dns 是 no 的,经排查说是登录认证的时候用到了 session 管理器,就是 systemd-logind 服务,但是这个服务器依赖了 org.freedesktop.systemd1 这个,没人遇到过吗
ytlm
2019-10-08 22:21:45 +08:00
1. dns 的问题
2. GSSAPIAuthentication no 这个配置试一下呢
3. ssh -vvv 看一下日志
xfspace
2019-10-09 08:42:31 +08:00
systemctl get-default
opsonly
2019-10-09 10:30:57 +08:00
@xfspace multi-user.target
xfspace
2019-10-09 11:04:46 +08:00
UID 0 改名没
ps1aniuge
2019-10-09 11:42:25 +08:00
yum update kernel openssh-server openssh-clients
最后面,有没有 s,我忘了。
更新内核后,重启下。若还不行,就重装新版。
opsonly
2019-10-09 14:39:10 +08:00
@xfspace 改了 跟这个有关吗
opsonly
2019-10-09 14:39:36 +08:00
@ps1aniuge 已经都更新了,但是感觉没变化
xfspace
2019-10-09 17:33:33 +08:00
@opsonly root 改名确实会导致
改回去 root 正常 不矢口 CentOS j8 原因

GNU/Debian 无此问题
opsonly
2019-10-09 19:03:05 +08:00
@xfspace 谢谢老哥!,这个折磨我好久了
Shawns
2021-03-11 15:47:45 +08:00
遇到同样问题,翻到旧贴,append 一下解决方法
systemctl daemon-reexec
参考 https://access.redhat.com/discussions/3536621

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/607068

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX