Host *
ControlPath ~/.ssh/sock/%r@%h:%p
ControlMaster auto
from Nijel’s weblog: Speed up SSH logins – is there any disadvantage to this? Also, “completition” is a great typo along the lines of my frequent “abou tit” one.ServerAliveInterval 3600
for reasons explained in the comments here.- Anything you like on the Standalone Sysadmin SSH series (ok, I cheated to get a list of three…)
-
Recent Posts
Recent Comments
- Pander on How hard can typing æ, ø and å be?
- Paul Menzel on Rinse and repeat
- mjr on FS-4400 Satellite PVR
- James Coke on FS-4400 Satellite PVR
- Peter M on Get the Survey Monkey Off Your Back
Tags
- banking
- board
- bristol
- business
- co-op
- community
- conference
- consultation
- cooperative
- cooperatives
- cooperatives-uk
- copyright
- debian
- election
- event
- events
- foss
- foundation
- free software
- government
- internet
- irc
- isp
- Koha
- library
- linux
- meeting
- mobile
- networking
- phone
- phonecoop
- plesk
- podcast
- review
- social enterprise
- software
- spam
- SPI
- ssh
- tv
- uk
- video
- web
- Web Development
Blogroll
Categories
Archives
- February 2018
- October 2016
- June 2015
- May 2015
- February 2015
- January 2015
- December 2014
- October 2014
- July 2014
- June 2014
- May 2014
- January 2014
- December 2013
- October 2013
- September 2013
- July 2013
- June 2013
- March 2013
- February 2013
- December 2012
- November 2012
- October 2012
- September 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
Meta
Yes, ControlMaster auto does have one major disadvantage: the first SSH session you start to a new system becomes the control master, and thus it can’t exit until all other SSH sessions using that same control master exit. So if you go to a terminal, run SSH, and then in another window do something else that opens an SSH session to the same host, the SSH in your original terminal will not exit after you quit.
However, if you set ControlPath but not ControlMaster, you can still enable ControlMaster for a specific SSH connection with the -M option to ssh. That way, you can control which instance of SSH becomes the control master.
Personally, I wish SSH had the ability to fork off a new control master in the background if one doesn’t already exist, and then that control master could automatically exit if a given amount of time passes since the last connection.
Thanks for noticing typo, fixed ;-).
I have noticed two major issues while using ControlMaster already:
– port forwarding only seems to work in the master session
– after some time, new connections are rejected, and I have yet to understand why.
Hi! Thanks a lot for the link to Standalone Sysadmin. I’m glad you found the series useful. Most of the credit goes to the other people who have been writing the other entries, but I’m happy to point to them!
Take care!
Port forwarding only works in the master session, but since most of my port forwardings are setup in .ssh/config anyway, that doesn’t bother me too much.
More annoying is IMHO that agent- and X-forwarding also only works when you thought of it at the time of establishing the master session. I often have to go through my tabs to find and kill the master session to a particular host, because the need for remote X or key forwarding only came up later.
Even so, I’m still staying with “ControlMaster auto”, as it certainly causes more convenience than harm for me.
Portforwarding (or rather the lack of it in the non-master sessions) is a serious issue. “ssh -S none” is your friend in such a situation.
Pete Savage: SSH tunneling :: The next step http://www.progbox.co.uk/wordpress/?p=580 describes the -w flag which was a new one on me, setting up tun network devices.
[…] Smart Tricks with ssh mentioned ServerAliveInterval 3600 and the page I referenced for it mentions ClientAliveInterval on the server-side. Is there any reason not to use that? […]