当我重新启动我的Linux服务器(BusyBox Linux)时,所有正在进行的ssh客户端连接都会运行到发生故障的状态,直到发生客户端的超时。 没有消息发送到SSH客户端产生“断开”错误消息。 这基本上使得ssh客户端看起来像被冻结的东西。
我使用sdd在OpenSSH_5.8p2版本中使用systemd与此服务configuration
[Unit] Description=SSH Per-Connection Server After=syslog.target [Service] ExecStart=/usr/sbin/sshd -i SuccessExitStatus=0 255 StandardInput=socket
有没有办法为sshdconfiguration优雅关机?
我的(rhel)服务器上的sshd会话可能会被标识为:
~# ps -ef |grep sshd: root 12120 1 0 10:18 ? 00:00:00 sshd: sysope [priv] sysope 12132 12120 0 10:18 ? 00:00:00 sshd: sysope@pts/2
杀死这些进程将立即closures连接。 因此,为你的sdd服务文件修改如下:
[Unit] Description=SSH Per-Connection Server After=syslog.target [Service] ExecStart=/usr/sbin/sshd -i ExecStop=/usr/sbin/killall -9 sshd SuccessExitStatus=0 255 StandardInput=socket