Copying files from server to local computer using SSH [closed]

Remoted remoted 2021. 7. 23. 17:47



Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.


Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 6 years ago.

Improve this question

I am having trouble copying files from a remote server using SSH. Using PuTTY I log in to the server using SSH. Once I find the file I would like to copy over to my computer, I use the command:

scp \local\dir\

It looks like it was successful, but it only ends up creating a new folder labeled 'localdir' in the remote directory /dir/of/.

How can I copy the file to my local computer over SSH?



Improve this question


edited Oct 5 '18 at 18:04


17k20 gold badges95 silver badges175 bronze badges

asked May 31 '15 at 3:07


1,0432 gold badges8 silver badges6 bronze badges

Add a comment

5 Answers




It depends on what your local OS is.

If your local OS is Unix-like, then try:

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

If your local OS is Windows ,then you should use pscp.exe utility. For example, below command will download file.txt from remote to D: disk of local machine.

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

It seems your Local OS is Unix, so try the former one.

For those who don't know what pscp.exe is and don't know where it is, you can always go to putty official website to download it. And then open a CMD prompt, go to the pscp.exe directory where you put it. Then execute the command as provided above


Improve this answer


edited May 31 '15 at 4:15


answered May 31 '15 at 3:23


15.8k11 gold badges43 silver badges63 bronze badges

  • My local OS is Windows. I downloaded the pscp.exe from the putty website. I tried opening it up and nothing came up. Also, I tried the command you listed above and was given: pscp.exe comman not found. Also tried it without the .exe and resulted in the same error. – Vincent May 31 '15 at 3:57 
  • 2
  • Open a CMD prompt, and go to the pscp.exe directory where you put it. Then execute the command as provided above. – mainframer May 31 '15 at 4:01 
  • 1
  • using scp on a mac has to be provided ./ parameter to signify that the file has to be downloaded in the current folder on mac machine. – Sarang Manjrekar Jul 2 '18 at 11:11
  • 2
  • With Windows Subsystem for Linux (WSL, basically Ubuntu on Windows) you can now also open up Bash if your Local OS is Windows, and just use scp. Pro-tip: you can access your Windows file system from WSL. It's under /mnt/c. So you can do something like this: scp username@remoteHost:/remote/dir/file.txt /mnt/c – gijswijs Apr 25 '19 at 3:42 
  • 3
  • As of the 2018 Autumn update, Windows 10 now comes with OpenSSH and is on PATH. This means you can use the scp command on Windows 10, too. – jaunt Sep 23 '19 at 20:45

Show 1 more comment