brandozz
brandozz

Reputation: 1119

Copy file from remote to local using ssh

I'm trying to copy a file from a Ubuntu server to my mac but I keep receiving a No such file or directory error.

After I ssh in I'm using:

scp -p 8888 [email protected]:/var/www/html/00000001.jpg /Users/myusername/Documents/

But receive the error:

/Users/myusername/Documents/: No such file or directory

Is this error telling me that there is no such file or directory on my local machine? Any advice as to how to fix would be greatly appreciated.

Upvotes: 7

Views: 34510

Answers (3)

silly
silly

Reputation: 947

Maybe you have multiple ssh connections open.

Try close all other connections and restart the scp command.

Upvotes: 0

Will
Will

Reputation: 24699

Yes, it's talking about your local machine. I'm guessing that you might have just typed something wrong. Try doing it like this instead:

scp -P 8888 [email protected]:/var/www/html/00000001.jpg ~/Documents/

Make sure you're typing this command at your Mac OS X Terminal prompt, not on the actual remote server. xx1.xx1.xx1.xx1 should be the remote Ubuntu machine ("pull" the file down to your machine, don't try to "push" it).

Also, although it's ssh -p, it's scp -P. For scp, -p just preserves modification times, and -P is the port.

Upvotes: 1

tokamak
tokamak

Reputation: 551

Don't ssh in to your server first. Just execute that scp command from your local machine.

EDIT:

Also, the -p should be capitalized (according to the manpage on my machine), so:

scp -P 8888 [email protected]:/var/www/html/00000001.jpg /Users/myusername/Documents/

Upvotes: 12

Related Questions