Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In my .ssh/config file I have the following:

Host xxx
User yyy
HostName zzzz
ControlMaster auto
ControlPath ~/.ssh/%r@%h:%p 

This works great for multiplexing my ssh connections (i.e. login once, and share the connection with multiple sessions).

I would like to multiplex (share) my ssh connection with rsync, so that I can do things like

rsync -arv -e ssh xxx:/source target

and not have to login through rsync (I have two-factor authentication system with XXX and it would be great if I can just skip that when I use rsync).

Update: I learn that by default rsync would try to re-use the connection first. So I am not sure why it isn't working. Here is the verbose output of my attempt:

> rsync -arv -e 'ssh -v' XXX:~/file ~/temp/.
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /home/YYYY/.ssh/config
debug1: Applying options for XXX
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: auto-mux: Trying existing master
Control socket connect(/home/YYY/.ssh/XXX@ZZZZ:22): Connection refused
share|improve this question
2  
This should be working. Maybe try -e 'ssh -v' to see if rsync over ssh is indeed looking for the ControlMaster socket? – jw013 Sep 19 '12 at 18:28
Thanks! @jw013 I have updated my post. – user815423426 Sep 19 '12 at 18:52
And yet, plain ssh not invoked by rsync works? – jw013 Sep 19 '12 at 19:00
Ì guess the space in Control master auto (rather than ControlMaster) is not contained in the config? – artistoex Sep 19 '12 at 19:03
@jw013, plain ssh not invoked by rsync works. yes. – user815423426 Sep 19 '12 at 19:06
show 11 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.