Copying files from the server to the local computer using ssh

I am having trouble copying files from a remote server using ssh. Using putty, I log in to the server using ssh. As soon as I find a file that I would like to copy to my computer, I use the command:

scp username@host.com : /dir/of/file.txt \ local \ dir \

This seems to be successful, but only ends up creating a new folder named localdir in the remote directory / dir / of /. Any help is greatly appreciated.

+4
source share
5 answers

It depends on your local OS.

If your local OS is similar to Unix, try:

scp username@remoteHost:/remote/dir/file.txt /local/dir/

- Windows, pscp.exe. , file.txt D: .

pscp.exe username@remoteHost:/remote/dir/file.txt d:\

, - Unix, .


, , pscp.exe , , putty , . CMD, pscp.exe, . ,

+12

scp , putty pscp.

C:\something> pscp username@host.com:/dir/of/file.txt \local\dir\
+1

.

scp username@host.com:/dir/of/file.txt \local\dir\file.txt
0

, , "ssh", , , , , , . scp -r.

, -

local> scp -r username@host.com:/path/to/dir local/path 

- , "scp-", .

0

, scp - .

BOTH server and client, otherwise you will come across this (strange) error message on your client: scp: command not foundor something similar, although you are all configured locally.

0
source

All Articles