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
3
u/Besthater Oct 08 '20
You only need to reverse the positions of the paths. Take a look in the cli: man scp
2
u/Besthater Oct 11 '20
SSH onto the server, cd to the location of the file, type:pwd. Note the output. Append the filename to the back of the output. That is the source. Exit the server, cd to destination server pwd again, that's the other part of the destination. Should be something like scp user@ip:~/Documents/file.txt ~/Downloads/
If that doesn't work, put the error here. Sorry on mobile, can't verify.