Duplicate ssh sessions without password prompt

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.

  • Pingback: Duplicating SSH session without login again « wing loon

  • http://www.alanbernard.com alanbernard

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

  • Rajaseelan

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

  • http://thedaneshproject.com Danny

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

© 2008-2012 The Danesh Project
Powered by Wordpress and made by Guerrilla. Hosted at ServerFreak