#navi(../)
* shutdownやrebootするとssh接続のターミナルが固まる場合の対処 [#z92bca1f]
Debianを最小構成+openssh-serverをインストールし発生した事象です。~
外部のPCからssh接続し、Debianサーバをshutdownまたはrebootしても、~
接続していたsshクライアントの端末には何も表示されず、ハングした状態になりました。~
本資料は、この事象を解決する方法を記しています。


#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
#contents

* 参考記事 [#z4e81e3a]
- serverfault~
[[SSH sessions hang on shutdown/reboot>http://serverfault.com/questions/706475/ssh-sessions-hang-on-shutdown-reboot]]
- StackExchange~
[[After sending shutdown command, ssh session doesn't terminate>http://unix.stackexchange.com/questions/216950/after-sending-shutdown-command-ssh-session-doesnt-terminate]]

* 使用したDebian [#ba1910e4]
 sakura@debian:~$ lsb_release -dr
 Description:    Debian GNU/Linux 8.6 (jessie)
 Release:        8.6

* 事象 [#z6e7f098]
以下のスクリーンショットの通り、shutdownしたのに、接続切断メッセージが表示されず、タイムアウト待ちになります。
#ref(01.png)

* 解決方法 [#lb4e14ce]
以下の手順で解決することができます。

+ターミナルを起動します。
+rootユーザにsuします。
+以下のコマンドでパッケージをインストールします。
  apt-get install libpam-systemd dbus
+再起動します。

上記の操作により、再度、外部PCからssh接続中にサーバをshutdown(systemctlpoweroff)またはreoot(systemctl reboot)してみてください。~
本事象が解決しているはずです。

* 対策後 [#p209ce6d]
以下のスクリーンショットの通り、接続断のメッセージが表示されプロンプトが戻ってきています。
#ref(02.png)

以上、shutdownやrebootするとssh接続のターミナルが固まる場合の対処方法でした。

#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)



トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS