could not resolve hostname with scp

scp
Mark picture Mark · Feb 2, 2014 · Viewed 42.9k times · Source

I am accessing an ubuntu server over ssh with putty on my windows machine and trying to download a single file to my local windows machine

my windows username is Mark and my hostname per cmd is Marks I am trying the following command on the remote server

scp backup.sql mark@marks:desktop

and I get could not resolve hostname I have tried to put in what I think myip address is and the connection times out

Answer

binarysubstrate picture binarysubstrate · Feb 2, 2014

The syntax is this, relative to where you're issuing the command:

scp user@host_from:location/file user@host_to:location/file

And of course if you're local you can omit the user@host prefixes:

scp local_file me@host_to:~/local_file

The direction is always from > to relative to where you issue the command.