SSH session copy under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.