SSH复用连接
Mac下没有用着特别爽的SSH客户端,所以基本就Terminal开SSH了。 经常的,连服务器得连好几个窗口,一边跑着程序,一边看日志。 以前Windows下用SecureCRT,可以Clone Session,直接复用当前的连接。OpenSSH也可以。 OpenSSH自带了配置:ControlMaster,ControlPath。 最简单的例子: Tab 1
1 2 3 4 5 6 7 8 9 10 11 12 |
sskaje$ ssh -v -o ControlMaster=auto -o ControlPath=/tmp/ssh-3.21.sock root@172.18.3.21 OpenSSH_6.9p1, LibreSSL 2.1.8 debug1: Reading configuration data /Users/sskaje/.ssh/config debug1: /Users/sskaje/.ssh/config line 14: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 20: Applying options for * debug1: auto-mux: Trying existing master debug1: Control socket "/tmp/ssh-3.21.sock" does not exist debug1: Connecting to 172.18.3.21 [172.18.3.21] port 22. debug1: Connection established. ... Last login: Fri Jul 1 00:51:04 2016 from 172.18.0.1 |
Tab 2
1 2 3 4 5 6 7 8 9 |
sskaje$ ssh -v -o ControlMaster=auto -o ControlPath=/tmp/ssh-3.21.sock root@172.18.3.21 OpenSSH_6.9p1, LibreSSL 2.1.8 debug1: Reading configuration data /Users/sskaje/.ssh/config debug1: /Users/sskaje/.ssh/config line 14: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 20: Applying options for * debug1: auto-mux: Trying existing master debug1: mux_client_request_session: master session id: 3 Last login: Fri Jul 1 00:53:42 2016 from 172.18.0.1 |
Incoming search terms:复用SSH连接spelldne复用SSH连接 调高数量XY OpenSSHWindows ssh 连接复用wellivwwant6xftriangleqzistraw7kcssh复用sshs mediagramlqrsmilej4mshootdi1roseei1pocket8s2pleasantf4vpairg4unearestl7ymattermj2Link to this post!