session multiplexing
WARNING: Please update your bookmarks! The content of this site has been moved to http://dille.name where it will be updated as needed. This page will remain unchanged.
although the openssh client supports session multiplexing as of version 3.9, i understand that the server offers the support for some time. it allows several logins to share the same session and therefore the same login credentials. you will not have to authenticate everytime you open a session.
session multiplexing can be implemented on the command line or in your ~/.ssh/config. the first session you create is set up as a master with a dedicated control socket. all consecutive sessions will only need to be supplied the control socket to share the same session as the master.
-
on the command line all sessions need the
-Sswitch for the dedicated control socket. the first session also needs the-Mswitch to set it up as a master.initiate the master session:
$ ssh -M -S ~/.ssh/.sock USER@HOST
initiate consecutive sessions
$ ssh -S ~/.ssh/.sock USER@HOST
-
using
~/.ssh/config, two entries need to be defined:Host myhost-master HostName myhost.example.com User myuser ControlMaster yes ControlPath ~/.ssh/socket-myhost Host myhost HostName myhost.example.com User myuser ControlPath ~/.ssh/socket-myhostthen, you can initiate the master session and launch consecutive sessions:
$ ssh myhost-master ... $ ssh myhost
for the master session, it is quite useful to push the ssh client into the background as demonstrated in background ssh:
$ ssh -fN myhost-master ... $ ssh myhost



