beer9
asked on
How to use scp using sudo ?
I am trying to doing scp a file from remote host to local location, file in the remote host has permission -rwx------ and owned by root and also permision in local directory has drwx------ and owned by root. I am trying to do like this to do a scp using ..
sudo scp hostname:/path/to/file.txt /destination/file.txt
but it doesn't seems to work.. as I can't read file on the remote host. How can I achieve it?
sudo scp hostname:/path/to/file.txt
but it doesn't seems to work.. as I can't read file on the remote host. How can I achieve it?
ASKER
It is asking me the root user's password of the remote host
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
... seems I missed "sudo" in front of the final "rm" in step (1,2). Sorry!
ASKER
Thank you :-)
your example above should work without a problem! What is the exact error message you get?
wmp