# 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 '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

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" [email protected]
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
[email protected]
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */

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