Problem
Need to copy files from one Linux VM to another (Ubuntu 18). Root account is not available, have accounts with sudo privileges.
Solution
Sample command listed below:
Refer to https://sk.solutionmentors.com/2019/05/run-commands-with-sudo-without-having.html for instructions.
Need to copy files from one Linux VM to another (Ubuntu 18). Root account is not available, have accounts with sudo privileges.
Solution
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.
No comments:
Post a Comment