Eu apenas tentei exatamente isso e funcionou para mim.
OBSERVAÇÃO: Eu também devo incluir que antes de executar os comandos abaixo eu executei este comando, que configura a conta de usuário no host remoto para uso com as credenciais ssh da minha conta de usuário local.
ssh-copy-id root@skinner
Minha configuração é a seguinte:
$HOME/.ssh/config
:
Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
IdentityFile ~/.ssh/id_dsa
Host skinner mulder byers
User root
conteúdo de $HOME/.ssh/
:
$ ls -dl ~/.ssh
drwx------ 2 saml saml 4096 May 23 03:18 /home/saml/.ssh
$ ls -l ~/.ssh
total 16
-rw------- 1 saml saml 204 May 23 03:17 config
-rw------- 1 saml saml 736 Jan 10 2011 id_dsa
-rw-r--r-- 1 saml saml 612 Jan 10 2011 id_dsa.pub
-rw-r--r-- 1 saml saml 401 May 23 03:17 known_hosts
Agora ssh para hospedar o skinner:
conteúdo de $HOME/.ssh/
:
$ ls -l ~/.ssh
total 16
-rw------- 1 saml saml 204 May 23 03:17 config
-rw------- 1 saml saml 736 Jan 10 2011 id_dsa
-rw-r--r-- 1 saml saml 612 Jan 10 2011 id_dsa.pub
-rw-r--r-- 1 saml saml 401 May 23 03:17 known_hosts
srw------- 1 saml saml 0 May 23 03:25 master-root@skinner:22
envia somefile.txt
para o host remoto:
$ rsync -arv -e ssh somefile.txt skinner:~
sending incremental file list
somefile.txt
sent 106 bytes received 31 bytes 91.33 bytes/sec
total size is 13 speedup is 0.09
extrai somefile.txt
do host remoto:
$ rsync -arv -e ssh skinner:~/somefile.txt somefile-remote.txt
receiving incremental file list
somefile.txt
sent 30 bytes received 100 bytes 260.00 bytes/sec
total size is 13 speedup is 0.10
resultados dos comandos rsync acima:
$ ls -l
total 8
-rw-rw-r-- 1 saml saml 13 May 23 03:19 somefile-remote.txt
-rw-rw-r-- 1 saml saml 13 May 23 03:19 somefile.txt
envia somefile.txt
para o host remoto (-v):
$ rsync -arv -e 'ssh -v' somefile.txt skinner:~
OpenSSH_5.5p1, OpenSSL 1.0.0e-fips 6 Sep 2011
debug1: Reading configuration data /home/saml/.ssh/config
debug1: Applying options for *
debug1: Applying options for skinner
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 5
sending incremental file list
somefile.txt
debug1: mux_client_request_session: master session id: 5
sent 106 bytes received 31 bytes 274.00 bytes/sec
total size is 13 speedup is 0.09
envia somefile.txt
para o host remoto (-vv):
$ rsync -arv -e 'ssh -vv' somefile.txt skinner:~
OpenSSH_5.5p1, OpenSSL 1.0.0e-fips 6 Sep 2011
debug1: Reading configuration data /home/saml/.ssh/config
debug1: Applying options for *
debug1: Applying options for skinner
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug1: mux_client_request_session: master session id: 5
sending incremental file list
somefile.txt
debug1: mux_client_request_session: master session id: 5
debug2: Received exit status from master 0
sent 106 bytes received 31 bytes 274.00 bytes/sec
total size is 13 speedup is 0.09