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
-e 'ssh -v'to see ifrsyncoversshis indeed looking for the ControlMaster socket? – jw013 Sep 19 '12 at 18:28sshnot invoked byrsyncworks? – jw013 Sep 19 '12 at 19:00Control master auto(rather thanControlMaster) is not contained in the config? – artistoex Sep 19 '12 at 19:03