Duplicate ssh session

June 11th, 2007 mysurface Posted in Admin, ssh | Hits: 49770 | 5 Comments »

If you are using secureCRT or ssh client, you may discovered that duplicate a ssh session you do not need to login again. That is convenient and fast!

I can do that with ssh command by just adding 2 lines shown as bellow into /etc/ssh/ssh_config
(Thanks to Geek00L)


ControlMaster auto
ControlPath ~/.ssh/socket-%r@%h:%p

You have to login for the first time, the first session will initiate a Control Master by creating a file at ~/.ssh indicate the login name, host and port. After that you can duplicate a ssh session by just execute a ssh command the same way you did for the first login, but this time password is not required.

Cool isn’t it?

Chinese Translation

5 Responses to “Duplicate ssh session”

  1. Siew, Wing Loon Says:

    I tried on your solution. It works for OpenSSH 4.3 (CentOS 5) but it doesn’t work for OpenSSH 3.6.1 (RHEL 3).

  2. Wing Loon:
    You are right, OpenSSH 3.6.1 doesn’t have

    ControlMaster auto

    Only yes or not, it happens to RHEL 4 too.

  3. Siew, Wing Loon Says:

    Only OpenSSH 4.0 above have ControlMaster support

    Please read this article below: –

    http://www.linux.com/article.pl?sid=06/05/19/145227

  4. Really nice tip Geek00L , thnx

  5. […] Found away to duplicate my session without retyping my password every time I initiate a connection the the server from my host machine thanks to  Linux By Examples. […]

Leave a Reply