ssh.service:設備進入失敗狀態

ssh.service:設備進入失敗狀態

sshd 啟動、運行並工作正常,但僅一次。如果我嘗試登入第二個 ssh 終端會話,我會被拒絕:

ssh: connect to host dmz port 22: Network is unreachable

和/或當我註銷 ssh 時,服務終止:

Jun 25 10:47:16 dmz sshd[29221]: Received disconnect from 10.0.0.101 port         57874:11: disconnected by user
Jun 25 10:47:16 dmz sshd[29221]: Disconnected from 10.0.0.101 port 57874
Jun 25 10:47:16 dmz sshd[29221]: debug1: do_cleanup
Jun 25 10:47:16 dmz sshd[29221]: debug1: do_cleanup
Jun 25 10:47:16 dmz sshd[29221]: debug1: PAM: cleanup
Jun 25 10:47:16 dmz sshd[29221]: debug1: PAM: closing session
Jun 25 10:47:16 dmz sshd[29221]: debug1: PAM: deleting credentials
Jun 25 10:47:16 dmz sshd[29221]: debug1: audit_event: unhandled event 12
Jun 25 10:47:16 dmz systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Jun 25 10:47:16 dmz systemd[1]: ssh.service: Unit entered failed state.
Jun 25 10:47:16 dmz systemd[1]: ssh.service: Failed with result 'exit-code'.

答案1

早些時候我剛剛看到了這個:

Jun 25 10:46:44 dmz sshd[29221]: debug1: Server will not fork when running in debugging mode.

……這看起來相當可疑。

檢查我看到的流程:

/etc/sbin/sshd -D -d

檢查 /etc/default/ssh 我看到:

SSHD_OPTS="-d"

我已經註解掉了。

我不知道為什麼要設定它,我不記得曾經設定過它,並且 ssh 工作正常,直到我將 14:04LTS 升級到 16:04LTS。

ssh 現在可以按預期工作。

相關內容