How to copy a folder from remote using remote user with sudo? None of these works on folders with permissions and fails with permission denied:scp -r userwithsudo@XX.XX.XX.XX:/source/ /destination/sudo scp -r userwithsudo@XX.XX.XX.XX:/source/ /destination/When I ssh on remote and perform sudo su then I can view those files and folders. For me it doesn't matter to use scp or smth else as long as it's ssh based.Maybe it's a limitation of scp to use sudo rights as security benefit. However it's really frustrating to be able to ssh, perform sudo su and view all the folders, however not be able to download from remote (though you can probably workaround that with tar and download anyway)
How to copy a folder from remote using remote user with sudo?
linux;ssh;scp
Ensure which user has to use sudo - local or remote (or both) users? i.e. sudo scp affects only local user rights to performing scp command.As a solution - try to move source files under another directory with remote user ownership and rights and check write permissions for the local user in place where destination folder should be created.Also try to move source to the remote user home directory - i.e. what path is in ~ (it could be a result of the server security policy).