Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to use scp to copy files from my Windows system to my Ubuntu server, and vice versa. As you know, when defining a path in Windows, "\" must be used instead of "/", and a "C:" at start.

Since every how-to about scp only contained linux-to-linux syntax, I used these to replace the Linux counterparts where needed. That is, I used the format "C:\FOLDER\FOLDER\FILE" for the Windows part of the arguments.

However, as I have seen, the copying of the files has been constantly failing, with the message:

"ssh: Could not resolve hostname C: No such file or directory
lost connection"

Any advice on what I have been doing wrong?

share|improve this question
Which scp implementation do you use on Windows? – Joni Oct 6 '13 at 10:17
Could you clarify your question? I dont know if I understood well, but if it's helpful, on the Windows client side I use putty. – Noob Doob Oct 6 '13 at 11:33
up vote 3 down vote accepted

It sounds like you're trying to scp from inside an existing PuTTY ssh session back to the Windows system - that's not going to work unless there is an SSH server running on Windows.

PuTTY itself isn't an scp client, however the 'full' Windows installation comes with a command-line client called pscp. The syntax for that is pretty much exactly how you'd expect, i.e. a *nix style host:/path/to/file/ for the target file on the remote host, and a Windows-style path for the local system - for example

C:\Users\steeldriver>"C:\Program Files (x86)\PuTTY\pscp.exe" steeldriver@ C:\Users\steeldriver\Downloads\linuxtests.tar
steeldriver@'s password:
linuxtests.tar            | 10 kB |  10.0 kB/s | ETA: 00:00:00 | 100%

The local path can be absolute i.e. C:\path\to\newfile or relative e.g. ..\newdir\newfile

However if you need to scp files regularly between *nix and Windows you may find it easier to use a dedicated client such as WinSCP

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.