-3

I'm trying to move a file from the server to my windows machine using cmd, first try:

scp username@lux.technion.ac.il:/home/username/Human_hg19_chr13/Alignment_calls.vcf C:\Users\FF\Desktop\cyberduck

The output: ssh: Could not resolve hostname c: Name or service not known

lost connection Connection to lux.technion.ac.il closed.

trying again:

scp username@lux.technion.ac.il:/home/username/Human_hg19_chr13/Alignment_calls.vcf C:\Users\FF\Desktop\cyberduck .

The output:

Alignment_calls.vcf
100% 964KB 45.9MB/s 00:00

ssh: Could not resolve hostname c: Name or service not known

Which means it almost worked but something went wrong at the end, I'm not sure is it my code?

Loui
  • 1
  • 2
    it didn't work first time because scp assumes that C:\Users... is the host definition - user@host:/path. However in the second case you have . at the end, so the file most likely was copied to the current directory. – mestia Jan 14 '22 at 22:06
  • Sorry, I still don't get what I'm supposed to fix in my code, I'm new at this so sorry for not getting it.. – Loui Jan 14 '22 at 22:28
  • scp uses a remote locatoin as user@server:/path/to/file or server:/path/to/file. Now if you have a path called C:\path\to\file, scp will think C is a server - it cannot find a server named C. Also I am confused: What environment are you using with the target being a windows-style path? – FelixJN Jan 14 '22 at 22:36
  • I'm using cmd, I'm using a windows machine which is where I want to transfer the wanted file. – Loui Jan 14 '22 at 22:41

1 Answers1

0

Meta: although OpenSSH (including scp) come from a Unix heritage, this isn't actually a Unix question, it's a Windows question. I approve deleting this if necessary to remove the Q.

  1. first go to the desired directory (with cd/d [drive:]\path, or drive: and/or cd \path as needed), then use . as the target (as you found)

  2. go to the desired disk with drive: and use \path without the drive specifier as the target (could also use cd/d drive:\anywhere but then #1 is just as easy)

  3. scp to the current directory with . and then move it to the desired directory

  4. use the UNC syntax \\localhost\c$\path