1

Is there a way to retrieve a secure copy in UNIX?

Why would I need to do this? Because I can login to a remote machine from my local machine, but not the other way around. So I need to retrieve a secure copy instead of just using scp to send a file from my remote machine to my local machine.

1
  • 4
    What's the difference between "retrieve a secure copy" and "use scp to send a file from remote to local"? Why is the latter not sufficient? Jul 21, 2014 at 13:15

2 Answers 2

8

scp can be used both to copy to a remote machine, and from one:

I assume you are used to using:

scp localfile USER@REMOTE:remotefile

But you can also use it to do:

scp USER@REMOTE:remotefile localfile
2
  • Worked!! Is there a way to get this to append to that local file, however?
    – MrPickles
    Jul 21, 2014 at 13:27
  • To my knowledge, not without going via a temporary file Jul 21, 2014 at 13:29
1

To append a remote file to a local one, improving Andrewe Stubbs answer copy to local stdout and append that:

 scp USER@REMOTE:remotefile /dev/stdout >> localeppendedfile

or simply (assuming a Posix remote machine)

 ssh USER@REMOTE /bin/cat removefile >> localeppendedfile

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .