robbat2: (Default)
[personal profile] robbat2

Cardoe was complaining that repeatedly hitting the Gentoo CVS server was too slow, and it turned out he wasn't using SSH ControlMaster at all. Other developers have blogged about it before, but here is a quick reminder how.

Without ControlMaster, running "time ssh robbat2@cvs.gentoo.org w" shows a turnaround of 1.9 seconds. With ControlMaster, It's more in the range of 0.07-0.09 seconds :-).

~/.ssh/config:
Host master-cvs.gentoo.org
    HostName cvs.gentoo.org
    User robbat2
    ControlMaster yes
    ControlPath ~/.ssh/master-%l-%h-%p-%r.sock
Host cvs.gentoo.org
    ControlMaster no 
    ControlPath ~/.ssh/master-%l-%h-%p-%r.sock
    BatchMode yes
Setup Usage:
ssh -f -n -N master-cvs.gentoo.org

Now just do anything like you would normally. For security, you should probably close the ControlMaster session if you're going away from your machine for a long time. It would be nice to detect the loss of the ControlMaster and re-initiate it always at the start of a sequence.

(no subject)

Date: 2008-08-06 07:40 am (UTC)
From: [identity profile] fox2mike.livejournal.com
Using ControlMaster with svn.gentoo.org seems to have issues.

svn list cf.snmp
Control socket connect(/home/shyam/.ssh/fox2mike@svn.gentoo.org-22-trinity): Connection refused
ControlSocket /home/shyam/.ssh/fox2mike@svn.gentoo.org-22-trinity already exists
svn: Connection closed unexpectedly

detecting disconnections

Date: 2008-08-06 04:57 pm (UTC)
From: (Anonymous)
It's Cardoe...

I believe ControlMaster auto will detect when the session went away and re-initiate it if I'm reading the man page right...

I'm trying to use that and we'll see if it happens to me.

Too complex

Date: 2008-08-21 02:41 pm (UTC)
From: (Anonymous)
Just set this:

Host *
ControlPath ~/.ssh/master-%l-%h-%p-%r.sock

And use ssh -NM when you want to create the master connection.

automatic control socket support

Date: 2008-12-28 02:34 am (UTC)
From: (Anonymous)
I used a simple wrapper script to automatically create a new control socket ssh when the old one died. You can find details in my blog post (http://blogs.23.nu/till/2008/12/ssh-via-cvs-with-automatic-control-socket-support/) about this.

May 2017

S M T W T F S
 123456
78910111213
141516171819 20
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags