Wednesday, May 1, 2019

Sync files using rsync with sudo privileges


Need to copy files from one Linux VM to another (Ubuntu 18). Root account is not available, have accounts with sudo privileges.


Sample command listed below:

sudo rsync -e "ssh" --rsync-path="sudo rsync" -Pav remoteuser@<remote server>:/mnt/disk01/folder_to_sync/ /mnt/disk01/folder_to_sync/

When executing, the system will ask you for password to existing user and then password for remoteuser.

Note, that remoteuser should be able to execute sudo command without prompting to type password.

Refer to for instructions.

No comments:

Post a Comment