Speed Up Multiple SSH Connections to the Same Server
来源:互联网 发布:软件开发委托合同 编辑:程序博客网 时间:2024/05/17 03:03
From: http://www.linuxjournal.com/content/speed-multiple-ssh-connections-same-server
If you run a lot of terminal tabs or scripts that all need to make OpenSSH connections to the same server, you can speed them all up with multiplexing: making the first one act as the master and letting the others share its TCP connection to the server.
If you don't already have a config file in the .ssh directory in your home directory, create it with permissions 600: readable and writeable only by you.
Then, add these lines:
Host * ControlMaster auto ControlPath ~/.ssh/master-%r@%h:%p
ControlMaster auto tells ssh to try to start a master if none is running, or to use an existing master otherwise.ControlPath is the location of a socket for the ssh processes to communicate among themselves. The%r, %h and %p are replaced with your user name, the host to which you're connecting and the port number—only ssh sessions from the same user to the same host on the same port can or should share a TCP connection, so each group of multiplexed ssh processes needs a separate socket.
To make sure it worked, start one ssh session and keep it running. Then, in another window, open another connection with the -v option:
~$ ssh -v example.com echo "hi"
And, instead of the long verbose messages of a normal ssh session, you'll see a few lines, ending
with:
debug1: auto-mux: Trying existing masterhi
Pretty fast.
If you have to connect to an old ssh implementation that doesn't support multiplexed connections, you can make a separate Host section:
Host antique.example.com ControlMaster no
For more info, see man ssh and man ssh_config.
- Speed Up Multiple SSH Connections to the Same Server
- Windows - "Multiple connections to a server or shared resource by the same user..."
- ‘Multiple connections to a server or shared resource by the same user的解决办法
- How to speed up the MV refresh
- the method to speed up your app
- Zen of PM - Getting the team up to speed
- IAR Build error: Multiple tools write to the same file
- Patch to allow multiple connections
- Using MAAS + Juju to speed up the cloud deployment under the VMs (by quqi99)
- On a new installed FreeBSD server, when you try to SSH to the server as root, you will end up in the
- How do I get multiple process to log to the same file?
- How to combine the value of multiple hashes within an array by the same key
- Ten ways to speed up the download time of your web pages
- Speed Up SQL Server Apps--ZT
- 50 Tools to Speed Up Your PC
- Rawether Does NOT Allow Multiple Applications To Receive The Same Packet
- Spark 2.1 , Method used to prevent multiple SparkContexts from being active at the same time
- Question 23: Which of the following C++ keywords are designed to speed up execution of a C++ function?
- Struts2与Spring整合
- Introduction to IIS 7 Architecture
- 关于java几种提交方式
- Windows虚拟主机完美实现wordpress伪静态终极方法
- 做了个CSDN相册图片上传工具
- Speed Up Multiple SSH Connections to the Same Server
- makefile so
- JMeter 2.5 发布,压力测试工具
- matlab-shell in emacs
- LINUX和我
- datafile 物理文件被删除后
- WINDOWS查找所用DLL时的搜索顺序
- 控制图片长度比例,及图片最大高度,最大宽度 JS代码
- jquery FireFox中滚动条设置为auto时,存在一个滞后显示的问题,如何获得滚动条的加载完毕事件或显示事件