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 [email protected]:/source/ /destination/
sudo scp -r [email protected]:/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)