I have a file on server A (which is behind a NAT so not directly addressable). The file needs to be copied to server B in a directory restricted to root. I have an account on server B with sudo privileges. What is the syntax for the scp command?
feedback
|
|
First, you need to copy the file to a place where you have write access without sudo,
Then move the file using sudo
If you do not have a writable place, make a temporary dir with write permission for your user.
| |||||||
feedback
|
|
You can use ssh and tar to work around this:
This first updates your sudo timestamp (asking for a password if necessary, which requires a tty ( "tar" on RedHat 5 requires the "--preserve" options to come after the "xpsf -" command. | ||||
|
feedback
|