在不断开连接的情况下更改 SSH 连接设置?

Mar*_*tin 3 ssh

我观看了SSH 的黑魔法视频,此视频中的讲师通过一些密钥组合进入了 SSH shell。他是如何做到的?

Bow*_*Red 6

如果您在谈论 openssh,您可以使用 3-key keystroke sequence 获得 ssh 转义菜单<ENTER>~?

$ ~?
Supported escape sequences:
~.  - terminate connection
~B  - send a BREAK to the remote system
~C  - open a command line
~R  - Request rekey (SSH protocol 2 only)
~^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.)
Run Code Online (Sandbox Code Playgroud)

这表明这<ENTER>~C将使您进入 ssh 命令行。从那里,您可以管理一些端口转发。

$ ~C
ssh> ?
Commands:
      -Lport:host:hostport    Request local forward
      -Rport:host:hostport    Request remote forward
      -KRhostport             Cancel remote forward
Run Code Online (Sandbox Code Playgroud)

否则,您可以使用<ENTER>~^Z.