Yesterday, I learned this tips and tricks from my colleague Danesh (or Danny). Thank you. His blog The Danesh Project
You can duplicate a current SSH session without login again…this is awesome and fast,
You need to add the following 2 lines below into your /etc/ssh/ssh_config file: -
ControlMaster auto
ControlPath ~/.ssh/socket-%r@%h:%p
You need to login into a remote SSH server for the first time, the SSH session will create a socket file at ~/.ssh folder indicating a login name, host and port.
ssh root@remotehost
Below is the SSH session socket file created: -
socket-root@remotehost:22
After that, you can duplicate the SSH session by just executing a same SSH command you did for the first login and this time there is no password prompt. You will login into the remote host directly.
This tips and tricks only works on OpenSSH 4.0 above. I had tried it on RHEL 3 (not working), RHEL 4 (not working) and CentOS 5 (working).