Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

could not resolve hostname with scp

Tags:

scp

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

like image 326
Mark Avatar asked Feb 02 '14 01:02

Mark


People also ask

Could not establish connection to could not resolve hostname?

This error means that the hostname you are trying to connect to cannot be resolved to an IP address. (Hostnames are resolved to IP addresses by a DNS (Domain NameServer)). Please check what you have entered in the Address field. You will need the valid hostname of an FTP server or a valid IP address.

Could not resolve hostname I no such host is known?

Stuck with 'SSH: could not resolve hostname: no such host' is known error? We can help you. This error implies that the server is down or the hostname is not given properly etc. At Bobcares, we often get requests from our customers regarding SSH as part of our Server Management Services.

Can't resolve hostname name or service not known Linux?

The ssh could not resolve hostname is a common error that any user can face. It is not that big of an issue. It simply happens when the ssh command fails to resolve the IP address of the provided hostname. In such situations clearing the DNS cache or editing the /etc/host file can help.

How do I SCP to a local machine?

SCP syntax is pretty simple. Just invoke SCP followed by the remote username, @, the IP address or host, colon, and the path to the file. If not specified, the default path is the remote user's home directory. Then, define the local path where the file will be stored locally.


1 Answers

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.

like image 194
binarysubstrate Avatar answered Sep 18 '22 04:09

binarysubstrate