sshで繋いで再起動、シャットダウンすると必ずクライアントがハングアップするので次のようにしました。
# 再起動
(sleep 5; reboot) & exit
Ctrl + D
# シャットダウン
(sleep 5; poweroff) & exit