Rsync: Difference between revisions

Rsync
No edit summary
No edit summary
Line 24: Line 24:


(On machineA)
(On machineA)
<code>sudo --preserve-env=SSH_AUTH_SOCK rsync -vrz --checksum /var/discourse root@machineB:/var</code>
<code>sudo --preserve-env=SSH_AUTH_SOCK rsync -vrz --checksum /var/discourse root@machineB:/var</code>
will successfully read all files on MachineA using elevated privileges of sudo, and transfer them to MachineB
will successfully read all files on MachineA using elevated privileges of sudo, and transfer them to MachineB


 
Note: to make a permanent configuration in sshd_config, you'd use something like this<ref>http://serverfault.com/questions/107187/ssh-agent-forwarding-and-sudo-to-another-user</ref>:
Defaults>root    env_keep+=SSH_AUTH_SOCK
{{References}}
{{References}}


[[Category:Filesystems]]
[[Category:Filesystems]]
[[Category:System Administration]]
[[Category:System Administration]]