Envy Windows under the SECURECRT session copy function, has been looking for Linux under similar software, but SSH itself to support this feature.
Special thanks to inspectable students for their email sharing.
Detailed method
?
| 1234 |
Linux/mac下,在$HOME/.ssh/config中加入Host *ControlMaster autoControlPath /tmp/ssh-%[email protected]%h |
So long as the first SSH login enter the password, then the same hosts are exempt.
Profile analysis
Man Ssh_config 5
?
| 123456 |
controlpath specify the path to the control socket used for connection sharing as Described in the Controlmaster section above or the String "None" to disable Connection Sharing. In the path, '%l ' is substituted by the local host Name, '%h ' is substituted by the target host name, '%p ' the port, and '%r ' by the remote login username. It is recommended this any controlpath used for opportunistic Connection sharing include at least%h,%p, and%r. This ensures, shared connections is uniquely identified. |
%r the logon name for the remote machine
%h for remote machine name
Principle Analysis
Strictly speaking, it is not a real session Copy, but only a shared socket.
The first time you log in, save the socket as a file to:/tmp/ssh-%[email protected]%h this path
After logging in, once found to be the same host, then reuse this socket
Therefore, once the main process is forced to exit (CTRL + C), other SSH is forced to exit.
The above procedure can be verified by the debug information through the SSH-V parameter.
Note
Some students say that in the form of a certificate on Linux, you can achieve free login, yes.
For a static password, this can be done completely, for the dynamic password (the way the password), the above means can be more convenient.
Http://www.cnblogs.com/killkill/archive/2012/05/22/2513192.html
SSH session copy under Linux