How do I SCP from remote machine to local machine?

JumpJump

I know there are some similar questions has been asked here and I did read them... however, I still can not copy a file from a remote machine down to my local computer... I am keep getting error like "No such file or directory"

Here is what I do. I open terminal on MacOS, log in to the remote machine, cd to the folder I want. Now, under this folder I have a .txt file, say "error.txt", and I want to copy this file down to my local desktop.

I get the directory for my local desktop by just drag the desktop folder into the terminal and I got a path /Users/myname/Desktop

Then I tried the following commands (while under the folder the error.txt is inside the remote machine):

scp -r error.txt /Users/myname/Desktop

or some variations

scp -r error.txt :/Users/myname/Desktop
scp -r error.txt ~/Users/myname/Desktop
scp -r error.txt Users/myname/Desktop

but all of them are keep giving me the error like

cannot create regular file `/Users/myname/Desktop': No such file or directory

Maybe my trouble is how to correct write my local path? But I can cd to my local desktop by using the path /Users/muname/Desktop while inside my local machine...

Any helps? Thank you!

Tonny

You are doing it wrong:
In Terminal DON'T login to the remote machine.
Just run:

scp user@remote:<path>/error.txt /Users/myname/Desktop 

In other words: Run SCP locally on your Mac and tell it to retrieve the file from the remote machine. When you are already logged in on the remote machine you need to scp from local (which is the remote machine in that case) to a remote machine (which is your Mac in that case).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I SCP from remote machine to local machine when I am outside of my home network?

From Dev

How do I use docker from local to a remote machine?

From Dev

scp protected file from remote machine to local machine through terminal

From Dev

SCP from ssh remote machine to my local ubuntu machine

From Dev

scp copy multiple files from remote machine to local machine

From Dev

scp protected file from remote machine to local machine through terminal

From Dev

I can ssh into a remote machine but I can't use scp to copy local stuff to the remote machine

From Dev

scp files from local to remote machine error: no such file or directory

From Java

How do I copy a folder from remote to local using scp?

From Dev

How to scp back to local when I've already sshed into remote machine?

From Dev

How to transfer a file between two remote servers using scp from a third, local machine?

From Dev

How to copy files with certain extensions keeping the path from remote to local machine via scp --parents?

From Dev

How to execute a shell script stored on remote machine from a local machine?

From Dev

How to copy a directory from local machine to remote machine

From Dev

How to copy a directory from local machine to remote machine

From Dev

How to copy files from local machine to remote virtual machine?

From Dev

How to copy (or move) files from remote machine to local machine?

From Dev

How do I create remote branch for pushing to from my machine?

From Dev

Unable to scp files from local machine into vagrant

From Dev

How do I copy-paste a massive excel file from a virtual machine server to my local machine?

From Dev

`docker-machine scp` from local directory to machine

From Dev

"No such file or directory" error when attempting to copy (using scp) from remote host to local machine

From Dev

Use SCP from local machine to recursively copy current working directory to remote?

From Dev

How can I execute local script on remote machine and include arguments?

From Dev

How to copy files from remote server to local machine?

From Dev

How to rdiff-backup / rsnapshot / backupninja from LOCAL to REMOTE machine?

From Dev

How to copy files from remote server to local machine?

From Dev

How to copy a file from a remote server to a local machine?

From Dev

How to copy files from a double remote server on a local machine

Related Related

  1. 1

    How do I SCP from remote machine to local machine when I am outside of my home network?

  2. 2

    How do I use docker from local to a remote machine?

  3. 3

    scp protected file from remote machine to local machine through terminal

  4. 4

    SCP from ssh remote machine to my local ubuntu machine

  5. 5

    scp copy multiple files from remote machine to local machine

  6. 6

    scp protected file from remote machine to local machine through terminal

  7. 7

    I can ssh into a remote machine but I can't use scp to copy local stuff to the remote machine

  8. 8

    scp files from local to remote machine error: no such file or directory

  9. 9

    How do I copy a folder from remote to local using scp?

  10. 10

    How to scp back to local when I've already sshed into remote machine?

  11. 11

    How to transfer a file between two remote servers using scp from a third, local machine?

  12. 12

    How to copy files with certain extensions keeping the path from remote to local machine via scp --parents?

  13. 13

    How to execute a shell script stored on remote machine from a local machine?

  14. 14

    How to copy a directory from local machine to remote machine

  15. 15

    How to copy a directory from local machine to remote machine

  16. 16

    How to copy files from local machine to remote virtual machine?

  17. 17

    How to copy (or move) files from remote machine to local machine?

  18. 18

    How do I create remote branch for pushing to from my machine?

  19. 19

    Unable to scp files from local machine into vagrant

  20. 20

    How do I copy-paste a massive excel file from a virtual machine server to my local machine?

  21. 21

    `docker-machine scp` from local directory to machine

  22. 22

    "No such file or directory" error when attempting to copy (using scp) from remote host to local machine

  23. 23

    Use SCP from local machine to recursively copy current working directory to remote?

  24. 24

    How can I execute local script on remote machine and include arguments?

  25. 25

    How to copy files from remote server to local machine?

  26. 26

    How to rdiff-backup / rsnapshot / backupninja from LOCAL to REMOTE machine?

  27. 27

    How to copy files from remote server to local machine?

  28. 28

    How to copy a file from a remote server to a local machine?

  29. 29

    How to copy files from a double remote server on a local machine

HotTag

Archive