# SSH scp between Ubuntu Server 12.04 and Windows failing - (prob syntax)

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?

-
Which scp implementation do you use on Windows? –  Joni Oct 6 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 at 11:33
add comment

## 1 Answer

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@192.168.1.12:/home/steeldriver/tests.tar C:\Users\steeldriver\Downloads\linuxtests.tar
steeldriver@192.168.1.12's password:
linuxtests.tar            | 10 kB |  10.0 kB/s | ETA: 00:00:00 | 100%
C:\Users\steeldriver>


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

-
add comment