ssh 中的escape sequences

  在ssh 连接成功后,正常的按键都会发送到当前会话中。想要对当前会话进行操作的话,只能使用escape sequences了。

  输入回车后,再输入~?就可以看到支持的命令了。

> ~?
Supported escape sequences:
 ~.   - terminate connection (and any multiplexed sessions)
 ~B   - send a BREAK to the remote system
 ~C   - open a command line
 ~R   - request rekey
 ~V/v - decrease/increase verbosity (LogLevel)
 ~^Z  - suspend ssh
 ~#   - list forwarded connections
 ~&   - background ssh (when waiting for connections to terminate)
 ~?   - this message
 ~~   - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)

  知道escape sequences 后,遇到由于网络问题导致ssh 会话无反应的情况,不用再关闭整个终端了,直接回车后输入~.就好了。

参考

  1. SSH Escape Sequences
  2. How can I break out of ssh when it locks?
您的浏览器已过时

要正常浏览本网站请升级您的浏览器。现在升级

×