pen*_*359 8 linux shell ssh openssh
通过 SSH 启动交互式 shell 对我的一台服务器来说很慢。包括协商加密在内的一切都很快,但它会挂起 45 秒。之后,它完成了,我有一个外壳。我如何识别它挂在什么上面?我尝试清除环境并禁用所有转发,以防它减慢速度,但没有帮助。这是我的测试命令:
env -i ssh -x -a -vvv server
Run Code Online (Sandbox Code Playgroud)
这是 SSH 的输出:
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
*(hangs for 45 seconds here)*
debug3: Wrote 128 bytes for a total of 3191
debug2: callback start
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
Run Code Online (Sandbox Code Playgroud)
在非常相似的情况下,它是 update-motd 脚本之一。
以下是诀窍:
sudo rm /etc/update-motd.d/90-updates-available
Run Code Online (Sandbox Code Playgroud)
这是一个测量每个脚本时间的小助手:
$ for f in /etc/update-motd.d/*;do echo $f;time $f;done
/etc/update-motd.d/00-header 0m0.007s
/etc/update-motd.d/10-help-text 0m0.005s
/etc/update-motd.d/90-updates-available 0m49.163s
/etc/update-motd.d/91-release-upgrade 0m0.152s
/etc/update-motd.d/98-fsck-at-reboot 0m0.015s
/etc/update-motd.d/98-reboot-required 0m0.003s
(output reduced to the relevant parts)
Run Code Online (Sandbox Code Playgroud)
pam_krb5.so 配置为获取不存在的 shell 的 AFS 令牌,该 shell 有 30 秒的超时时间,会停止使用该模块的任何身份验证,而不仅仅是 SSH。删除它,身份验证会发生得更快。
| 归档时间: |
|
| 查看次数: |
10525 次 |
| 最近记录: |