• About
  • Archive
  • RSS

code.dump();

re-using SSH connections

The ssh ControlMaster setting “allows you to re-use an existing SSH connection whenever you connect to a host you are already connected to.”

In your ~/.ssh/config file, add:

Host *
    ControlMaster auto
    ControlPath /tmp/%r@%h:%p

Whenever you connect to server.example.com as user joeuser, SSH will create a named pipe at /tmp/joeuser@server.example.com:22. If you open another connection to the same server (as the same user), instead of creating a new TCP/IP connection, SSH will automatically multiplex the new session with the existing connection (through the named pipe)! This reduces time spent setting up new connections.

  • Posted by inky
  • Tags:
    • ssh
  • December 29, 2008, 3:46pm

  • Permalink
← Previous Post   Next Post →

About

A place for code snippets, keyboard shortcuts, dirty hacks and other fun tricks. Use at your own risk!

Members

  • inky
  • arood
  • beret
  • nosmo

Search

Colophon

A group tumblelog, originally by inky. Powered by Tumblr and themed by Bill Israel.