.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