Link to home
Start Free TrialLog in
Avatar of beer9
beer9Flag for India

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?
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Hi,
 
 your example above should work without a problem! What is the exact  error message you get?

 wmp
Avatar of beer9

ASKER

It is asking me the root user's password of the remote host
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
... seems I missed "sudo" in front of the final "rm" in step (1,2). Sorry!
Avatar of beer9

ASKER

Thank you :-)