Rsync remote data as root using sudo

Rsync remote data as root using sudo

If your user has sudo on the remote box, you can rsync data as root without needing to login as root. This is very helpful if the remote box does not allow root to login over SSH (which is a common security restriction).

example:

rsync --rsync-path 'sudo rsync' username@source:/folder/ /local/