Duplicate ssh sessions without password prompt

15 Jun, 2007  |  Posted by Danesh  |  in Linux

I work with multiple ssh sessions whenever I connect to a server. Typically I would have about 3 sessions initiated from my host machine to the destination server.

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.

Add the following 2 lines to your /etc/ssh/ssh_config file and feature will be ready for you to use once you restart the sshd service.

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

ssh-dup.jpg

ControlMaster
Enables the sharing of multiple sessions over a  single
network  connection.   When  set  to  “yes”  ssh will
listen for connections on a  control  socket  specified
using  the  ControlPath  argument.  Additional sessions
can connect to this socket using the  same  ControlPath
with  ControlMaster set to “no” (the default).  These
sessions will reuse the master instance’s network  con-
nection  rather than initiating new ones.  Setting this
to “ask” will cause ssh to listen for control connec-
tions,  but  require confirmation using the SSH_ASKPASS
program before they are accepted  (see  ssh-add(1)  for
details).

ControlPath
Specify  the  path  to  the  control  socket  used  for
connection sharing.  See ControlMaster above.

  • Digg
  • del.icio.us
  • BlinkList
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Furl
  • Google
  • Live
  • Facebook
  • Pownce
  • TwitThis
  • E-mail this story to a friend!
Tags: ,

4 Responses so far | Have Your Say!

  1. Duplicating SSH session without login again « wing loon  |  June 16th, 2007 at 2:55 pm #

    [...] Sat 16 Jun 2007 Duplicating SSH session without login again Posted by wingloon under Linux  Yesterday, I learned this tips and tricks from my colleague Danesh (or Danny). Thank you. His blog The Danesh Project [...]

    Duplicating SSH session without login again « wing loon - Gravatar
  2. alanbernard  |  June 16th, 2007 at 5:25 pm #

    I just realized that your site does not really have a contact form. Perhaps you may want to add that in? Just a suggestion.

    alanbernard - Gravatar
  3. Rajaseelan  |  June 25th, 2007 at 7:44 am #

    I see you pimped your windows already?
    Whats that eh ? WindowsBlinds ? Or the real VIsta?

    Rajaseelan - Gravatar
  4. Danny  |  June 26th, 2007 at 4:42 am #

    The real Vista. But it sucks!!!!!

    Danny - Gravatar

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>