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?