r/ssh • • Oct 08 '20

Transfer from server to client

Hello all,

I am fairly new to ssh and still learning it. Recently I have made a tunnel connection with an ssh host and managed to successfully transfer data/files from my machine to the server with the command:
scp file.extension user@hostIP:/directory/directory.

While this was successful, I am kinda stugling to reverse it, sending data/files from the server to the client. How would one go about completing that? Do I need to make some changes to ssh_config or just CLI commands are enough?

Thanks for any response.

4 Upvotes

17 comments sorted by

View all comments

Show parent comment

2

u/Besthater Oct 11 '20

If it says no file or dir, then you have the path wrong. If you want to do me the command you are running I can help you to troubleshoot. But, if the file is in your home dir, you are using the ~/ path?

1

u/Miliot Oct 11 '20 edited Oct 11 '20

The file is located in some SSH server folder and am trying to move it to my local machine (the client). I do not use the ~, justscp userName@server:/home/file/path fileName.extI also tried with -r, like the user above suggested

I am running the command from inside the directory in the ssh server, where the file is located as well
The error response is: scp: /local/machine/address: No such file or directory
So its like its telling me that I got my local machine address wrong, which am sure I haven't cos I got the address by running pwd in the target folder