4 Answers
4

I assume that you do not have the password to the other user account, nor to the root account, and/or the remote host does not allow direct root login via SSH.

If it is not too much data, I would just SSH in beforehand, become root, create a tarball of the data, grant access to the tarball for your regular user, then download the tarball as your regular user.

is there an easier way of doing this yet? I want to copy files I only have sudo permissions to but taring them every time isn't fun. Is there really no way to scp as sudo on remote host?
–
waspinatorFeb 7 '12 at 17:05

(assuming gnu tar for -C support, it can be done without it using '()' but it's trickier) and of course, you can do the sudo on the remote end:

tar c -C my_trojan_files . | ssh remote_host sudo tar xv -C /usr/bin

The trick here is that, in both cases, tar is emitting the archive to STDOUT, which is being piped into the command running on the remote host via ssh. You can do this with cpio and dump/restore as well.