SSHでコンピューターをサスペンドした後にターミナルを元に戻す方法は?


14

スリープ状態にするためだけに、SSHを使ってコンピュータにSSHで接続することがよくあります。問題は、スリープするとき、SSH接続を開いたままにすることです(一見無期限に)。発生することは次のとおりです。

oli@bert:~$ ssh tank
oli@tank:~$ sudo pm-suspend
[sudo] password for oli:

パスワードを入力してヒットするReturnとハングします...リモートマシンをスリープ解除するまで。

端末を閉じて別の端末を起動せずに端末を元に戻すことができるように、ローカルで強制的に切断する方法はありますか?


Oli:あなたが何をしているかに応じて、画面を使用したり、ssh経由でコマンドを送信したりできますか?強制コマンドでキーを使用することもできます。
パンサー

1
こちらもご覧ください:askubuntu.com/q/35719/158442
muru

回答:


14

SSHエスケープコードを入力してください!からman ssh

ESCAPE CHARACTERS
 When a pseudo-terminal has been requested, ssh supports a number of
 functions through the use of an escape character.

 A single tilde character can be sent as ~~ or by following the tilde by a
 character other than those described below.  The escape character must
 always follow a newline to be interpreted as special.  The escape
 character can be changed in configuration files using the EscapeChar
 configuration directive or on the command line by the -e option.

 The supported escapes (assuming the default ‘~’) are:

 ~.      Disconnect.

 ~^Z     Background ssh.

 ~&      Background ssh at logout when waiting for forwarded connection /
         X11 sessions to terminate.

だから:を押しEnter~.ます。

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.