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.
To copy the files you will need to first invoke the SCP, followed by the remote username@IP address, path to file. If you do not specify the path, it is assumed as default in this case which will be the user's home directory, this will be followed the path where the file will be stored locally.
It's based on the SSH protocol used with it. A client can use an SCP to upload files to a remote server safely, download files, or even transfer files via SSH across remote servers.
Often you will need to move one or more files/folders or copy them to a different location. You can do so using an SSH connection. The commands which you would need to use are mv (short from move) and cp (short from copy). By executing the above command you will move (rename) the file original_file to new_name.
Copy or Download a File From Remote to Local Using SCP SCP syntax is pretty simple. Just invoke SCP followed by the remote username, @, the IP address or host, colon, and the path to the file. If not specified, the default path is the remote user's home directory.
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/
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With