以前用PuTTY的时候,可以在会话过程中新开tunnel,而不需要断开原有连接重连。
后来命令行下,想着这么复杂的操作,PuTTY也是因为有GUI才好配置,所以一直当openssh命令行客户端不支持此功能。
直到看到ssh支持Escape Char,才发现原来可以这么搞。
ssh默认的escape char是 ~ 。
1 2 3 4 5 6 7 8 9 10 11 12 13 |
root@dev-21:~# ~? 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.) |
这些命令,大都是按着SHIFT不放的。。。
Continue reading “SSH命令行不重连新加tunnel” »
SSH命令行不重连新加tunnel by @sskaje: https://sskaje.me/2016/07/ssh-cli-client-add-new-tunnel-on-the-fly/