Host does not exist ошибка

25 мая, 2017 11:40 дп
93 893 views
| Комментариев нет

Linux, SSH

В первой статье этой серии вы узнали о том, как и в каких ситуациях вы можете попробовать исправить ошибки SSH. Остальные статьи расскажут, как определить и устранить ошибки:

  • Ошибки протокола: в этой статье вы узнаете, что делать, если сбрасываются клиентские соединения, клиент жалуется на шифрование или возникают проблемы с неизвестным или измененным удаленным хостом.
  • Ошибки аутентификации: поможет устранить проблемы с парольной аутентификацией или сбросом SSH-ключей.
  • Ошибки оболочки: это руководство поможет исправить ошибки ветвления процессов, валидации оболочки и доступа к домашнему каталогу.

Для взаимодействия SSH-клиента с SSH-сервером необходимо установить базовое сетевое подключение. Это руководство поможет определить некоторые общие ошибки подключения, исправить их и предотвратить их возникновение в будущем.

Требования

  • Убедитесь, что можете подключиться к виртуальному серверу через консоль.
  • Проверьте панель на предмет текущих проблем, влияющих на работу и состояние сервера и гипервизора.

Основные ошибки

Разрешение имени хоста

Большинство ошибок подключения возникает тогда, когда ссылка на хост SSH не может быть сопоставлена с сетевым адресом. Это почти всегда связано с DNS, но первопричина часто бывает не связана с DNS.

На клиенте OpenSSH эта команда:

ssh user@example.com

может выдать ошибку:

ssh: Could not resolve hostname example.com: Name or service not known

В PuTTY может появиться такая ошибка:

Unable to open connection to example.com Host does not exist

Чтобы устранить эту ошибку, можно попробовать следующее:

  • Проверьте правильность написания имени хоста.
  • Убедитесь, что вы можете разрешить имя хоста на клиентской машине с помощью команды ping. Обратитесь к сторонним сайтам (WhatsMyDns.net, например), чтобы подтвердить результаты.

Если у вас возникают проблемы с разрешением DNS на любом уровне, в качестве промежуточного решения можно использовать IP-адрес сервера, например:

ssh user@111.111.111.111
# вместо
ssh user@example.com.

Истечение времени соединения

Эта ошибка значит, что клиент попытался установить соединение с SSH-сервером, но сервер не смог ответить в течение заданного периода ожидания.

На клиенте OpenSSH следующая команда:

ssh user@111.111.111.111

выдаст такую ошибку:

ssh: connect to host 111.111.111.111 port 22: Connection timed out

В PuTTY ошибка выглядит так:

Network error: Connection timed out

Чтобы исправить ошибку:

  • Убедитесь, что IP-адрес хоста указан правильно.
  • Убедитесь, что сеть поддерживает подключение через используемый порт SSH. Некоторые публичные сети могут блокировать порт 22 или пользовательские SSH-порты. Чтобы проверить работу порта, можно, например, попробовать подключиться к другим хостам через этот же порт. Это поможет вам определить, не связана ли проблема с самим сервером.
  • Проверьте правила брандмауэра. Убедитесь, что политика по умолчанию – не DROP.

Отказ в соединении

Эта ошибка означает, что запрос передается на хост SSH, но хост не может успешно принять запрос.

На клиенте OpenSSH следующая команда выдаст ошибку:

ssh user@111.111.111.111
ssh: connect to host 111.111.111.111 port 22: Connection refused

В PuTTY ошибка появится в диалоговом окне:

Network error: Connection refused

Эта ошибка имеет общие с ошибкой Connection Timeout причины. Чтобы исправить её, можно сделать следующее:

  • Убедиться, что IP-адрес хоста указан правильно.
  • Убедиться, что сеть поддерживает подключение через используемый порт SSH. Некоторые публичные сети могут блокировать порт 22 или пользовательские SSH-порты. Чтобы проверить работу порта, можно, например, попробовать подключиться к другим хостам через этот же порт.
  • Проверить правила брандмауэра. Убедитесь, что политика по умолчанию – не DROP, и что брандмауэр не блокирует этот порт.
  • Убедиться, что сервис запущен и привязан к требуемому порту.

Рекомендации по исправлению ошибок подключения

Брандмауэр

Иногда проблемы с подключением возникают из-за брандмауэра. Он может блокировать отдельные порты или сервисы.

Читайте также: Что такое брандмауэр и как он работает?

В разных дистрибутивах используются разные брандмауэры. Вы должны научиться изменять правила и политики своего брандмауэра. В Ubuntu обычно используется UFW, в CentOS – FirewallD. Брандмауэр iptables используется независимо от системы.

Читайте также:

  • Основы UFW: общие правила и команды фаервола
  • Настройка брандмауэра FirewallD в CentOS 7
  • Основы Iptables: общие правила и команды брандмауэра

Чтобы настроить брандмауэр, нужно знать порт сервиса SSH. По умолчанию это порт 22.

Чтобы запросить список правил iptables, введите:

iptables -nL

Такой вывод сообщает, что правил, блокирующих SSH, нет:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Если в выводе вы видите правило или политику по умолчанию REJECT или DROP, убедитесь, что цепочка INPUT разрешает доступ к порту SSH.

Чтобы запросить список правил FirewallD, введите:

firewall-cmd --list-services

Список, появившийся на экране, содержит все сервисы, которые поддерживаются брандмауэром. В списке должно быть правило:

dhcpv6-client http ssh

Если вы настроили пользовательский порт SSH, используйте опцию –list-ports. Если вы создали пользовательское определение сервиса, добавьте опцию –list-services, чтобы найти SSH.

Чтобы проверить состояние UFW, введите:

ufw status

Команда вернёт доступные порты:

Status: active
To                         Action      From
--                         ------      ----
22                         LIMIT       Anywhere
443                        ALLOW       Anywhere
80                         ALLOW       Anywhere
Anywhere                   ALLOW       192.168.0.0
22 (v6)                    LIMIT       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
80 (v6)                    ALLOW       Anywhere (v6)

В списке должен быть порт SSH.

Проверка состояния сервиса SSH

Если вы не можете подключиться к серверу по SSH, убедитесь, что сервис SSH запущен. Способ сделать это зависит от операционной системы сервера. В более старых версиях дистрибутивов (Ubuntu 14.04, CentOS 6, Debian 8) используется команда service. Современные дистрибутивы на основе Systemd используют команду systemctl.

Метод проверки состояния сервиса может варьироваться от системы к системе. В более старых версиях (Ubuntu 14 и ниже, CentOS 6, Debian 6) используется команда service, поддерживаемая системой инициализации Upstart, а в более современных дистрибутивах для управления сервисом используется команда systemctl.

Примечание: В дистрибутивах Red Hat (CentOS и Fedora) сервис называется sshd, а в Debian и Ubuntu – ssh.

В более старых версия используйте команду:

service ssh status

Если процесс работает должным образом, вы увидите вывод, который содержит PID:

ssh start/running, process 1262

Если сервис не работает, вы увидите:

ssh stop/waiting

В системах на основе SystemD используйте:

systemctl status sshd

В выводе должна быть строка active:

sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)
Active: active (running) since Mon 2017-03-20 11:00:22 EDT; 1 months 1 days ago
Process: 899 ExecStartPre=/usr/sbin/sshd-keygen (code=exited, status=0/SUCCESS)
Main PID: 906 (sshd)
CGroup: /system.slice/sshd.service
├─  906 /usr/sbin/sshd -D
├─26941 sshd: [accepted]
└─26942 sshd: [net]

Если сервис не работает, вы увидите в выводе inactive:

sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)
Active: inactive (dead) since Fri 2017-04-21 08:36:13 EDT; 2s ago
Process: 906 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=0/SUCCESS)
Process: 899 ExecStartPre=/usr/sbin/sshd-keygen (code=exited, status=0/SUCCESS)
Main PID: 906 (code=exited, status=0/SUCCESS)

Чтобы перезапустить сервис, введите соответственно:

service ssh start
systemctl start sshd

Проверка порта SSH

Существует два основных способа проверить порт SSH: проверить конфигурационный файл SSH или просмотреть запущенный процесс.

Как правило, конфигурационный файл SSH хранится в /etc/ssh/sshd_config. Стандартный порт 22 может переопределяться любой строкой в этом файле, определяющей директиву Port.

Запустите поиск по файлу с помощью команды:

grep Port /etc/ssh/sshd_config

Читайте также: Использование Grep и регулярных выражений для поиска текстовых шаблонов в Linux

Команда вернёт:

Port 22

Если вы уже убедились, что сервис работает, теперь вы можете узнать, работает ли он на требуемом порте. Для этого используйте команду ss. Команда netstat –plnt выдаст аналогичный результат, но команду ss рекомендуется использовать для запроса информации сокета из ядра.

ss -plnt

В выводе должно быть указано имя программы и порт, который она прослушивает. Например, следующий вывод сообщает, что сервис SSH прослушивает все интерфейсы и порт 22.

State       Recv-Q Send-Q              Local Address:Port                       Peer Address:Port
LISTEN      0      128                 *:22                                     *:*                   users:(("sshd",pid=1493,fd=3))
LISTEN      0      128                 :::22                                    :::*                  users:(("sshd",pid=1493,fd=4))

Символ * и 0.0.0.0 указывает, что все интерфейсы сервера прослушиваются. Строка 127.0.0.1 значит, что сервис не является общедоступным. В sshd_config директива ListenAddress должна быть закомментирована, чтобы прослушивать все интерфейсы, или должна содержать внешний IP-адрес сервера.

Если у вас не получается самостоятельно настроить соединение SSH, вы можете обратиться за помощью к службе поддержки своего хостинг-провайдера.

Tags: firewalld, Iptables, OpenSSH, PuTTY, SSH, UFW

I am using Putty to ssh into some of the servers that I work on. I am able to connect all others except the one. Although I was able to connect to it before. Whenever I try connecting to it, it always give me error:

Unable to open connection on myhost: Host does not exist

My firewall is off and I have even re-installed putty but that did not fix it. When I tried connecting to the same server using putty on some other windows system, I was able to do so. I searched regarding this on Internet but did not find much relevant.

I am running putty on Windows 7.

What can be the possible issue?

halfer's user avatar

halfer

19.8k17 gold badges98 silver badges185 bronze badges

asked May 30, 2015 at 11:48

POOJA GUPTA's user avatar

6

For me the problem was with the Url of the reposity. Check remote URL. It must start with git@github.com, not https://.

See screenshot for example

answered Nov 25, 2015 at 23:39

BraveNewMath's user avatar

BraveNewMathBraveNewMath

7,9905 gold badges46 silver badges51 bronze badges

0

As I understand you have three computers involved. At the same time one connection is working and the other one fails. So we can exclude that the ssh daemon on your linux box is hanging.
In lack of knowing their real names I will call your computers linuxbox (this is the computer you want to ssh into), win7ok (that is the computer that you are able to ssh from using putty) and win7fail (that obviously is the computer you can’t connect from).

Please do a tracert from both Win7 computers:

tracert linuxbox.your.domain
tracert linuxbox

Add the results to your question as it will help us find out what is happening.

Perhaps it is also a good idea to determine the ip address of the linuxbox from win7ok:

ping linuxbox

or

nslookup linuxbox

Then try to connect from win7fail by using the ip address of the target computer, perhaps it is only a DNS problem (which might be as nmap is failing too).

To make all of this easier to understand for us please provide the real names of the computers as you use them in putty.

answered May 30, 2015 at 14:13

Marged's user avatar

MargedMarged

10.5k10 gold badges56 silver badges99 bronze badges

5

I used nslookup and then used the ip address it gave me to connect and it worked

answered Mar 24, 2016 at 14:26

tercou1's user avatar

tercou1tercou1

3493 silver badges8 bronze badges

I had a similar problem with GitExtensions. The solution was to remove the https url and replace it with git@gitlab….

WRONG:
enter image description here

GOOD:
enter image description here

answered Feb 3, 2020 at 22:35

ADM-IT's user avatar

ADM-ITADM-IT

3,6221 gold badge25 silver badges25 bronze badges

I just went through this. I have a Cisco VPN I need to use to get through to the Linux machine I wanted to login to and check.

No Putty session would get through using the machines name.
An nslookup on the windows machine yielded the correct address.
I too connected right in via the ip address.
I tried to Google the error and it failed, so I suspected the wireless.

Disconnected and reconnected my WiFi and all was good.
I did it fast enough that open connections stayed open.
And new connections refering to DNS names worked fine.

Seems like maybe some cached DNS addresses were stale.

Jonathan's user avatar

Jonathan

6,4875 gold badges37 silver badges47 bronze badges

answered Jul 27, 2017 at 2:36

DrMayhem's user avatar

Your DNS cache stores the locations (IP addresses) of web servers that contain web pages which you have recently viewed. If the location of the web server changes before the entry in your DNS cache updates, you can no longer access the site.

Following CLI command will do the trick:

ipconfig /flushdns

answered Mar 21, 2018 at 10:00

muley's user avatar

muleymuley

415 bronze badges

This page shows common problems experienced with SSH in general, and when establishing an SSH tunnel, and solutions for each problem.

Tip: Most port-forwarding problems are caused by a basic misunderstanding of how an SSH tunnel actually works, so it is highly recommended that you read the SSH Tunnel page before continuing.

Table of Contents

Connection Problems

Unable to open connection: Host does not exist

Connection fails with the following error:

Unable to open connection:
Host does not exist

This error occurs when:

  • The server name cannot be resolved to an IP address. If it could be, a different error would be displayed (such as Connection refused). Check the server exists and is reachable using PING.
ping servername

Unable to open connection: gethostbyname: unknown error

Connection fails with the following error:

Unable to open connection:
gethostbyname: unknown error

This error occurs when:

  • You are using an older version of PLINK. Try upgrading PLINK.

Connection refused

Connection fails with the following error:

Failed to connect to 100.101.102.103: Network error: Connection refused
Network error: Connection refused
FATAL ERROR: Network error: Connection refused

This error occurs when:

  • The server name is incorrect. Verify the server exists and is running SSHD.
  • The port specified with the -P (PLINK/PuTTY) or -p (ssh) argument is incorrect. Verify that the port is correct.
  • There is a firewall or other connection problem between the two servers. Try using telnet to telnet to the server/port.

Failed to add the host to the list of known hosts (/home/USERNAME/.ssh/known_hosts)

Connection works, but the following warning is issued

Failed to add the host to the list of known hosts (/home/USERNAME/.ssh/known_hosts)

This error occurs when:

  • The user’s HOME folder has incorrect permissions
  • The user’s HOME/.ssh folder or HOME/.ssh/known_hosts file has incorrect permissions (such as when the folder has been copied into location by root, or permissions have been manually set incorrectly)

To fix, execute these commands (as root) to reset the permissions to their correct values (replace USERNAME with the appropriate username)

cd ~
chown USERNAME /home/username
chown USERNAME -R /home/username/.ssh
chmod 700 /home/USERNAME/.ssh
chmod 600 /home/USERNAME/.ssh/*

Authentication Problems

When using a key, you are prompted for a password (instead of automatically authenticating)

This can be caused be:

  • Providing a passphrase on the key. Verify that you have created the SSH key-pair with no passphrase
  • Incorrect setup on the SSH server (key file or security not correctly configured). In some cases, no error will appear in the SSHD logs on the server.
  • Incorrect key specified on the client. For example, specifying the public key in the command line arguments instead of the private key.
  • Incorrect username specified for the key. For example, the key has been installed for user «neale» but you are connecting as username «cassie».

Unable to use key file «keysKEYNAME.ppk» (unable to open file)

This is caused by an inability to open the specified SSH key file.

  • Verify that the key file exists, and is really at the location you have specified with the -i argument
  • Verify that the local user executing the PLINK/ssh command has permissions to read the key file

Tunnel Problems / Port Forwarding Problems

Note that some of these errors will only appear if verbose-output (-v) is switched on for the PLINK command or SSH commands. PuTTY hides them, but PLINK can be used with exactly the same command line arguments, so test with PLINK and the -v command line option.

Forwarded connection refused by server: Administratively prohibited [open failed], or channel N: open failed: administratively prohibited: open failed

This error appears in the PLINK/PuTTY/ssh window when:

  • the port forwarding address does not exist (most common reason, normally a typo)
  • port-forwarding has been disabled server-wide in /etc/ssh/sshd_config using AllowTcpForwarding no (default setting is yes)
  • port-forwarding is limited to specific hosts only (and the one you are connecting to is not in the list), in the server-wide setting file /etc/ssh/sshd_config under the PermitOpen option. Note that even if the host is allowed in permitopen in authorized_keys2 (see below), it still needs to be allowed in sshd_config as well.
  • you are using a certificate-based connection and port-forwarding has been disabled in /home/username/.ssh/authorized_keys2 with the option no-port-forwarding
  • you are using a certificate-based connection and port-forwarding is limited to specific hosts only (and the one you are connecting to is not in the list), in the /home/username/.ssh/authorized_keys2 file using the permitopen= option
  • a DNS problem on the server is preventing the host name from being resolved to an IP address (error in DNS, or manual entry in /etc/hosts)

For example, you have tried to connect to servername.example.com using an SSH command line argument such as:

-L 127.0.0.1:3500:servername.example.com:3506

However, servername.example.com does not exist, is not permitted, or cannot be resolved correctly by the remote server. Unfortunately, the error message is quite vague, and always makes it look like a security issue. Verify the server name is correct and try again, then check with your administrator.

When this is the problem the following will appear in the SSH server logs (eg: /var/log/auth.log in Linux):

Nov 28 17:00:57 server sshd[27850]: error: connect_to servername.example.com: unknown host (Name or service not known)

or

Aug 26 17:48:10 server sshd[24180]: Received request to connect to host servername.example.com port NNNN, but the request was denied.

Forwarded connection refused by server: Connect failed [Connection refused]

This error appears in the PLINK/PuTTY/ssh window, when you try to establish a connection to the tunnel, and the server cannot connect to the remote port specified.

For example, you have specified that the tunnel goes to servername.example.com:3506 using an SSH command line argument such as:

-L 127.0.0.1:3500:servername.example.com:3506

When you then try to telnet to 127.0.0.1:3500 on the client machine, this is tunnelled through to the server, which then attempts to connect to servername.example.com:3506. However, that that connection between the server and servername.example.com:3506 is refused.

Check the tunnel server:port is correct, or ensure that the server is able to connect to the specified server:port.

Service lookup failed for destination port «»

This error appears in the PLINK/PuTTY/ssh window, if your tunnel definition is incomplete or incorrect.

For example, the additional space after «3500:» in the following line will cause this error:

line which causes error:
-L 127.0.0.1:3500: mysql5.metawerx.net:3506
correct line:
-L 127.0.0.1:3500:mysql5.metawerx.net:3506

Local port 127.0.0.1:nnnnn forwarding to nnn.nnn.nnn.nnn:nnnnn failed: Network error: Permission denied

This error appears in the PLINK/PuTTY/ssh window, if your PuTTY client cannot listen on the local port you have specified.

This normally occurs because of another service already running on that port.

For example, the tunnel below will fail if you have a local version of SQL/Server already listening on port 1433:

-L 127.0.0.1:1433:sql2005-1.metawerx.net:1433

To fix, close the program that is listening on that port (ie: SQL/Server in the example above).

Advanced: You can also adjust to tunnel from another port, such as 127.0.0.2:1433 or 127.0.0.1:1434. However, with SQL/Server, the Management Console application will only allow connections to 1433. Additionally, it listens on 0.0.0.0:1433, preventing use of port 1433 on any other IP address. Therefore, unless you first adjust the SQL/Server registry settings to listen on a specific IP first, it is not possible to have SQL/Server running at the same time as a local tunnel.

<some program>: not found

If you have connected successfully, but get errors when you try to enter commands at the tunnel prompt, this is because you have access to the tunnel itself, but not to an SSH prompt or any tools on the server. You should not be running these commands at the SSH prompt itself.

Example errors:

  • createuser: not found
  • mysql: not found

If you were trying to establish an SSH tunnel, you have already accomplished this part. Your tunnel should be listening on 127.0.0.1:<some port>. The commands you are trying to execute should be performed in a new Command Prompt or Shell.

Remember — the tunnel is providing access to a remote service, on your local machine, as if the server is your own computer.

You can therefore use any command line or GUI tools at your disposal, and connect directly to 127.0.0.1:<whatever port>.

If you are confused about how this works, see the SSH Tunnel page for diagrams and a full explanation.

See Also

  • SSH Tunnel for a guide on how tunnels work
  • How to generate an SSH key pair
  • Support Topics page for examples of setting up remote database connections over SSH


Problem not found / not solved? Something to add?

  • If your problem is not solved by the above guide, please click Add Comment and specify the error message or problem you are having. This will allow us improve this guide.
  • If you have helpful information to add, please feel free to add a comment or register so that you can edit this page yourself.

Hi,

I do

> ssh -L 873:myotherhost:873 myusername@myotherhost

as root. This connects just fine. myotherhost is running
an rsync server which also seems to work fine.

But

> rsync -vvv somefile rsync://localhost:873/someremotefile

times out and

> nmap localhost

does not see 873 as open.

—Geza Bohus, 08-May-2007


Hi Geza,

After the ssh command, port 873 should immediately open. This is because ssh itself opens the port. Can you try adding -v to the ssh command to see if it displays any messages about opening port 873 during initialisation, then use netstat directly afterwards to see if the port has been opened?

eg: netstat -pant (instead of nmap, which is more useful for port scans)

Also check on the server, in /var/log/syslog and see if any messages appear either after the ssh command, or after the rsync command. If the port opens locally after ssh, but then cannot be established on the server, the error message should appear in the servers syslog.

—Neale Rudd, 08-May-2007


Hi Neale,

Thanks for your comments/advice. I’ll check these things and write down my experiences.

Geza

—Geza Bohus, 09-May-2007


Hi Neale,

The port is indeed open now, although I haven’t consiously changed anything except the -v in the ssh command.

It seems that I have problems using the rsync server, not the tunnel itself.

Thanks again for your help.

—Geza Bohus, 09-May-2007


Hi Geza,

Now that port 873 is open, you should be able to telnet to it with: telnet localhost 873

SSH will accept the connection, and tunnel it through to the server on port 22 (SSH). The server will accept the information through the tunnel on port 22, and then try to open a connection to myotherhost:873. When it attempts this connection, it sounds like something is failing. Therefore the next step would be to confirm that port 873 is open on the server as well. If it is open, but only listening on 127.0.0.1 (ie: it’s own localhost), then your ssh command would need to be modified to:

ssh -L 873:localhost:873 myusername@myotherhost

This is actually a shortened version. The full command being used in this case is:

ssh -L localhost:873:localhost:873 myusername@myotherhost

The first localhost:873 is the port to be opened on the client (SSH opens this). The second localhost:873 is the port the server opens when asked to by the client (SSHD opens this).

The most common problem in this case, is that your RSYNC server on the server (myotherhost) is only listening on localhost (127.0.0.1). Therefore if you have 873:myotherhost:873, you are telling the server to try and connect to «myotherhost», which will fail.

Let me know if that solves the problem.

—NealeRudd, 10-May-2007


Hi Neale,

I just realized you wrote one more comment. Thanks for your help, everything is working now.

Geza

—Geza Bohus, 07-Jun-2007

«Host does not exist»

  • Reply to topic
  • Log in

Advertisement

rickyj

Guest

2008-05-28 20:32

I receive the «Host does not exist» message when trying to use the /script=filename option. However, when I use manually enter the same information that is in the file using winscp interactively, I can login to the server without any problems. Why??????

Reply with quote

Advertisement

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2008-05-30

That doesn’t make any sense.

1) Do you use the same binary (exe) for GUI and the script? And from the same directory? From the same host?

2) Please post the script.

3) Post a log file of success in GUI and failure with script.

Reply with quote

Grandilo

Guest

2008-08-04 14:47

Hello i have the same problem, when i lauch the script in console mod, i have «host does not exist» but if i write open in winscp console and my @ip of my server, it works

my script :

option batch on
option confirm off
open root@172.20.20.2
option transfer binary
get /root/test
close
exit

in exemple, its user@exemple.com, if its only user@ip there is a pb?

Reply with quote

martin◆

Site Admin
martin avatar

2008-08-05

Hello i have the same problem, when i lauch the script in console mod, i have «host does not exist» but if i write open in winscp console and my @ip of my server, it works

So do you use IP address in both cases or hostname in the first?

Reply with quote

Delphi

Guest

2008-08-27 10:25

In my case I had used batch files to start several sessions at once. This was no problem as long as I left them directly in the base folder.

c:
cd ProgrammeWinSCP3
START WinSCP.exe "connection25"
PING -n 2 127.0.0.1>nul               # poor man's delay
START WinSCP.exe "connection32"

Meanwhile this list had grown much too long so I moved many of the connections into project specific folders. I changed my batch accordingly

c:
cd ProgrammeWinSCP3
START WinSCP.exe "folder/connection1"
PING -n 2 127.0.0.1>nul               # poor man's delay
START WinSCP.exe "folder/connection2"

Well and now it says «Host does not exist» — but if I open them manually they work perfectly. Any idea what I am doing wrong?

Reply with quote

Advertisement

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2008-08-29

Delphi wrote:

In my case I had used batch files to start several sessions at once. This was no problem as long as I left them directly in the base folder.


Thanks for your post. This issue has been added to tracker.

Reply with quote

Jimboberlin

Guest

2009-04-01 22:13

Hi — according to your tracker this bug has been resolved — I get the same error with this simple script:

Code

# Connect 
open root@87.230.6.132
# Change remote directory
cd /srw/www/bulk_files/rails/down/app/
# Force binary mode transfer
option transfer binary
# update folder
keepuptodate d:progphp_projectsdownapp /srw/www/bulk_files/rails/down/app/
# Disconnect
close
# Exit WinSCP
exit

Output:

Searching for host...
Host does not exist

When entering the same commands in the shell everything works like a charm!

Any Ideas?

Reply with quote

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2009-04-03

Jimboberlin wrote:

Hi — according to your tracker this bug has been resolved

I do not see any relation to the referenced bug.

When entering the same commands in the shell everything works like a charm!

Any Ideas?

Please post a full log file showing the problem. Both log file from the shell and script.

Reply with quote

martin◆

Site Admin
martin avatar

2009-04-06

Reply with quote

Advertisement

Priyaranjan

Guest

2009-07-10 10:50

I am running python to initiate winscp to synchronize my folder with a central server. I had the same problem. When I run the python with a web page winscp returns error host doesn’t exist. But, when I run the code directly, it was working. So, after going through a lot of documentation, I thought of trying sftp://username:password@hostaddress and when tried this, it failed and the reason is it returned a hostkey to accept in the stdout. That means this session of winscp is running like a fresh connection to that host eventhough I have connected to that host before. So, I copied the host key in stdout used with -hostkey==»My Key» option at the end of open command and it worked. Now I am able to run a python code behind a webpage to synchronize my files. If at all this makes any sense to you, try it yourselves leave a feedback.

Reply with quote

Priyaranjan

Guest

2009-07-13 05:42

Sorry about the typo in the last post.

My commands are like following.

I use a bat file to initiate the commands

bat file code

@echo off
winscp.com /script="C:runthis.txt"

runthis.txt code

option batch on
option confirm off
open sftp://user:password@host:port -hostkey="ssh-blah blah"
synchronize remote -criteria='both' "C:Backuptest" "/www/cgi-bin/test"
chmod 644 /www/cgi-bin/test/*.html
chmod 775 /www/cgi-bin/test/*.py
synchronize remote -criteria='both' "C:Backup" "/www/cgi-bin"
chmod 644 /www/cgi-bin/*.html
chmod 775 /www/cgi-bin/*.py
synchronize remote -criteria='both' "C:js" "/www/htdocs/test/js/"
exit

winscp.exe did not work for me from the webpage. winscp.com worked fine. Don’t know why.

Reply with quote

sridhar

Guest

2010-02-25 22:31

I am able to manually run my batch file to upload file but it fails when I use ssis process task. can you tell me what might be the cause?

Reply with quote

martin◆

Site Admin
martin avatar

2010-02-26

sridhar wrote:

I am able to manually run my batch file to upload file but it fails when I use ssis process task. can you tell me what might be the cause?

Please read FAQ. If that does not help, come back.

Reply with quote

Advertisement

Guest

2010-02-26 18:38

I read that. I solved this problem by replacing script argument with command argument but now I am getting different problem.It uploads the file but failing with error «Assertion failied:random_active>=0». you mentioned that you fixed the bug in latest release. I installed latest version. I have the host key in INI file and ran command to read from INI file rather than registry.here is the command argument.

script= /command «option batch on» «open username:password@ftp.ftp.com» «optin transfer binary» «put xxx_DEV.csv» «close» «exit». If i run from command prompt I am not getting error. if i run it on ssis package I am getting this error. can you help me on this?

Reply with quote

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2010-03-01

Anonymous wrote:

It uploads the file but failing with error «Assertion failied:random_active>=0». you mentioned that you fixed the bug in latest release. I installed latest version. I have the host key in INI file and ran command to read from INI file rather than registry.here is the command argument.

Thanks for your post. This bug is being tracked already.

Reply with quote

Guest

2010-03-30 21:35

entering the command:

winscp /console script.tmp

instead of

winscp /console /script=script.tmp

will result in ‘Host not found’, I think new users sometimes just don’t see the ‘/script=’ part I know I didn’t.

Reply with quote

anoni

Guest

2010-05-29 10:15

you suck.. you did not answer their question. And the problem is true.

Reply with quote

Advertisement

collinj

Guest

2010-08-02 07:50

prikryl, you don’t why you even bother to look at post. From your input it is clear you do not have an idea what the problems are!

Reply with quote

collinj

Guest

2010-08-02 07:54

Sorry for the typo. I want to re-type this to make it clear.

prikryl, I don’t know why you even bother to reply to these posts. You obviously don’t have a clue!

Reply with quote

Caipre

Guest

2010-08-08 15:40

I was having this exact issue — entering the hostname, login, and password from the CLI worked fine, but running a batch script of the same information failed with the «Host does not exist» message. The log indicated that the program had confused the /script=»…» parameter as the hostname.

I noticed the version of WinSCP was out of date, so I updated.

Works as expected now.

Reply with quote

guest2011

Guest

2011-05-01 22:47

This problem exists when you use batch script to execute COM program, like this:

(winscp.cmd)

d:myappsWinSCPWinSCP.com %1 %2 %3 %4 %5 %6 %7 %8 %9

and in the main batch:

winscp /script=»%FTPSCRIPT%»

When you change the main batch to:

d:myappsWinSCPWinSCP.com /script=»%FTPSCRIPT%»

everything works OK

Looks like COM program reads command line arguments in non-standard way.

Reply with quote

Advertisement

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2011-05-02

guest2011 wrote:

and in the main batch:

winscp /script=»%FTPSCRIPT%»

When you change the main batch to:

d:myappsWinSCPWinSCP.com /script=»%FTPSCRIPT%»

What is value of FTPSCRIPT?

Reply with quote

Guest

2011-05-05 19:52

FTPSCRIPT doesn’t have spaces or special characters, it is equal to:

C:UsersmyuserAppDataLocalTempmyscr.ftp

where «myuser» is current user’s profile name and «myscr.ftp» is script file name.

Reply with quote

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2011-05-09

Anonymous wrote:

FTPSCRIPT doesn’t have spaces or special characters, it is equal to:

C:UsersmyuserAppDataLocalTempmyscr.ftp

where «myuser» is current user’s profile name and «myscr.ftp» is script file name.

Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.

Reply with quote

Guest

2011-05-15 21:00

I found an error — it was inside my batch, the call to *.cmd should be:

winscp «/script=%FTPSCRIPT%»

This is because Windows «eats» ‘=’ character inside parameters, if not enclosed by quotation marks.

Reply with quote

Advertisement

caio

Guest

2011-05-19 03:48

Well, i’ve just installed winscp on my machine and wants to copy files to a remote backup folder…

when i run winscp.com and then use the command open ftp://user:pass@IP:port, it connects fine…but if i run one script with the command «open ftp://user:pass@IP:port» inside (without the quotes), it keeps saying Host does not exist…is there any way to debug this error, so i can find why it keeps happening?i think it’s some problem on parsing the string in the script file, but can’t be sure, it’s just a guess…

well, any help would be appreciated…thanks in advance

Reply with quote

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2011-05-19

caio wrote:

Well, i’ve just installed winscp on my machine and wants to copy files to a remote backup folder…

when i run winscp.com and then use the command open ftp://user:pass@IP:port, it connects fine…but if i run one script with the command «open ftp://user:pass@IP:port» inside (without the quotes), it keeps saying Host does not exist…is there any way to debug this error, so i can find why it keeps happening?i think it’s some problem on parsing the string in the script file, but can’t be sure, it’s just a guess…

well, any help would be appreciated…thanks in advance

Just enable logging to see how WinSCP parsed the URL.

Reply with quote

caio

Guest

2011-05-19 18:38

Hey, it worked now, thanks…

Reply with quote

dmartin
Joined:
2011-05-25
Posts:
1
Location:
Melbourne Australia

2011-05-25 11:35

Hi Can someone please help me I am just about had enough with Winscp and trying to connect my iphone. I have gone through all of the forums and try everything and have no luck?

My Specs are as follows;

1. Windows 7

2. Iphone 4 — IOS 4.3.3 Jailbroken with Cydia installed

3. Openssh installed and working fine

4. SBsettings — ssh toggle turned on

5. when I try to connect to my iphone I get «network error — connection refused»

Trust I have tried everything as per lot of those forum installing Ipohne tunnel programs and still have no luck. I would really really appreciate any help from someone.

Thanks you.

Reply with quote

Advertisement

BryWalt

Guest

2012-05-14 08:03

martin wrote:

caio wrote:

Well, i’ve just installed winscp on my machine and wants to copy files to a remote backup folder…

when i run winscp.com and then use the command open ftp://user:pass@IP:port, it connects fine…but if i run one script with the command «open ftp://user:pass@IP:port» inside (without the quotes), it keeps saying Host does not exist…is there any way to debug this error, so i can find why it keeps happening?i think it’s some problem on parsing the string in the script file, but can’t be sure, it’s just a guess…

well, any help would be appreciated…thanks in advance

Just enable logging to see how WinSCP parsed the URL.

Prikryl, I wish you could offer more help! For example, your answer above could go much further if you explained how to ENABLE LOGGING! Geez!

Reply with quote

Jimmy S

Guest

2013-08-30 17:02

rickyj wrote:

I receive the «Host does not exist» message when trying to use the /script=filename option. However, when I use manually enter the same information that is in the file using winscp interactively, I can login to the server without any problems. Why??????

I could fix it, I don’t know if it is going to work in your case, adding the path of the winscp into the script. For example:

This is what I had with «Host does not exist»

winscp.com GyT /script=gyt.txt

then I changed it to this and it worked(basically I pointed out the path of winscp command and the script):

c:progra~2winscpwinscp.com GyT /script=c:ftptransgyt.txt

Cheers!

Reply with quote

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2013-09-03

Jimmy S wrote:

I could fix it, I don’t know if it is going to work in your case, adding the path of the winscp into the script. For example:

This is what I had with «Host does not exist»

winscp.com GyT /script=gyt.txt

then I changed it to this and it worked(basically I pointed out the path of winscp command and the script):

c:progra~2winscpwinscp.com GyT /script=c:ftptransgyt.txt

1) You should not open site for scripting using command-line parameter. Use open command from the script instead.

2) Path to a script file cannot make a difference for this.

3) Path to a winscp.com makes a difference, when you are using an INI file stored in c:progra~2winscp and your PATH actually points to a different instance of winscp.com (with different configuration) that does not know the «GyT» site.

The best to do is to avoid depending on a configuration:

https://winscp.net/eng/docs/scripting#configuration

Reply with quote

ravi3300

Guest

2017-11-30 04:56

hi..

when i trying to open any file from ftp site then got error Host «C» does not exist.

winscp error pls help

Reply with quote

Advertisement

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2017-11-30

ravi3300 wrote:

hi..

when i trying to open any file from ftp site then got error Host «C» does not exist.

winscp error pls help

Please start a new thread for your new problem and include a complete session log file.

Reply with quote

millerintllc
Joined:
2018-06-17
Posts:
2

2018-06-17 01:29

10 years later and I have the same exact problem…

Reply with quote

martin◆

Site Admin
martin avatar
Joined:
2002-12-10
Posts:
38,937
Location:
Prague, Czechia

2018-06-19

millerintllc wrote:

10 years later and I have the same exact problem…

And I have same exact answer:

Please start a new thread for your new problem and include a complete session log file.

Reply with quote

NoUsername

Guest

2020-11-24 10:47

Hello. I encountered this problem (with powershell) and this thread. In my case, the problem was an invalid character.

Error: Exception calling «Open» with «1» argument(s): «Host «<FQDN>» does not exist.»

The hostname property is set with this regexp:

$sftpLine -match '(^sftp -o Port=)(?<port>[0-9]+) (?<username>.*)@(?<hostname>.*)$'
$sftpHostname=$matches.hostname

Problem: the regexp output includes the carriage return character (in powershell: «`r»).

$sftpHostname.Replace("`r",'') -eq $sftpHostname
False

Note that the powershell error does not show the carriage return character anywhere. I found it by looking at the session output. $session.Output:

...
winscp> open "sftp://username:***@hostname%0D:2222" -hostkey="ssh-rsa 2048 xx:xx:xx.." -timeout=15
...

Look at the hostname, it ends with «%0D». That is not good…

The fix? Replace the invalid character with nothing:

$sftpHostname=$matches.hostname.Replace("`r",'')

Reply with quote

Advertisement

  • Reply to topic
  • Log in

You can post new topics in this forum

@robvelor

Hi guys, I’m facing an issue running the scp command on docker machine for windows.

Machine version (Windows 7):

$ docker-machine version
docker-machine.exe version 0.6.0, build e27fb87

Command:

$ docker-machine scp ~/myfile.txt local-swarm-node-1:~/
Error loading host: Error loading host: Host does not exist: "C"

My guess is machine thinks the path /c/ is a machine instead of a path on the host machine. Is this supported on windows?

Are only relative paths supported on windows?

@fsoppelsa

Probably a colon : present in Windows expanded paths like C:Documentsmyfile.txt disturbs the scp clients, that expect a colon : is used to separate host from path.

@nathanleclaire

Yes, for scp you are forced into Unix-style filepaths for the time being. Try using the Toolbox quickstart (or MYSYS_NO_PATHCONV=1 in Git for Windows) and using the Unix notation:

$ docker-machine scp /c/users/rob/myfile.txt local-swarm-node-1:/home/docker

@machzqcq

Tried in git-bash and docker quickstart terminal — same error though

pradeep@seleniumframework ~
$ export MYSYS_NO_PATHCONV=1

pradeep@seleniumframework ~
$ docker-machine scp /c/Users/pradeep/.docker/machine/machines/default/ca.pem default:/home/docker/.docker/
Error loading host: Error loading host: Host does not exist: "C"

@nathanleclaire

It looks a lot like it’s still attempt path translation. Make sure you’re using Git for Windows as it’s only a specific version that supports MSYS_NO_PATHCONV.

@robvelor

@nathanleclaire I was using another terminal when I reported this, let me test with the quickstart one and see.

@robvelor

Nope same error with the quickstart terminal and Unix notation.

$ docker-machine scp /c/Users/rvelasquez/myfile.txt local-swarm-node-1:~/
Error loading host: Error loading host: Host does not exist: "C"

@revelashaun

I just tried this and it worked… localhost:/c/some-path

@fsoppelsa

@efrecon

I just bumped into the same problem, and indeed the solution is to:

  1. Make sure you specify localhost: at the beginning (there is some specific code in the go implementation around localhost:)
  2. Use «mounted» path, according to cygwin or whichever shell you are using on your windows machine.

This makes it hard to script docker-machine from the outside. I’ve just put in a fix for machinery around this. What I do is to call mount (which exists in most NIX-like environments on Windows) to list out where c: (or whichever the windows drive letter was) is mounted onto the shell file system. I then cache this for the life-time of the program. It works, but it’s kind of clumsy.

Maybe should this (or similar) be done in docker-machine instead. Note that the scp.go implementation workaround using localhost: will have to be modded as it does a split on :, which obviously isn’t doing a proper job when the file path contains a : itself. What do you think @nathanleclaire ?

@Mhussein27

Dears ,please let me know what to do!!
I am not able to copy from my local windows8 machine to the remote ubuntu machine I am using GITbash..The below is sample from my Gitbash output

Maha.Sallam@Maha MINGW64 ~/.ssh
$ MYSYS_NO_PATHCONV=1

Maha.Sallam@Maha MINGW64 /.ssh
$ docker-machine scp -r /C/Users/Maha.Sallam/.ssh default:/.ssh
Error loading host: Error loading host: Host does not exist: «C»

Maha.Sallam@Maha MINGW64 ~/.ssh
$ docker-machine scp -r /.ssh default:/.ssh
Error loading host: Error loading host: Host does not exist: «C»

Maha.Sallam@Maha MINGW64 /.ssh
$ docker-machine scp -r localhost:/C/Users/Maha.Sallam/.ssh default:/.ssh
id_rsa 100% 1675 428.6KB/s 00:00
id_rsa.pub 100% 398 128.1KB/s 00:00

@Mhussein27

@efrecon

I don’t understand, @Mhussein27 the last line in your output examples seems to have performed well?

@mprasil

We couldn’t get it working even with localhost: prepended, but there’s a quick workaround with cat if you want to transfer just one file:

docker-machine ssh machine_name "cat > /destination/file" < /c/source/path/file

@SvenDowideit

and to add another weird version of the problem to the stack:

$ docker-machine -D scp gitlab:~/test .
Docker Machine Version:  0.13.0, build 9ba6da9
Found binary path at C:Program FilesDockerDockerResourcesbindocker-machine.exe
Launching plugin server for driver openstack
Plugin server listening at address 127.0.0.1:64527
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(sima-gitlab) Calling .GetSSHPort
(sima-gitlab) Calling .GetSSHKeyPath
(sima-gitlab) Calling .GetSSHKeyPath
(sima-gitlab) Calling .GetSSHKeyPath
(sima-gitlab) Calling .GetSSHHostname
(sima-gitlab) Calling .GetSSHUsername
{C:Program FilesGitusrbinscp.exe [C:Program FilesGitusrbinscp.exe -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -3 -o IdentitiesOnly=yes -o Port=22 -o IdentityFile="C:\Users\dow184\.docker\machine\machines\gitlab\id_rsa" debian@43.240.97.7:~/test .] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> <nil> false [] [] [] [] <nil> <nil>}
usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2
exit status 1

dow184@TOWER-SL MINGW64 ~/src/deployment (master)
$ uname -a
MINGW64_NT-10.0 TOWER-SL 2.9.0(0.318/5/3) 2018-01-12 23:37 x86_64 Msys

dow184@TOWER-SL MINGW64 ~/src/deployment (master)
$ scp  -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -3 -o IdentitiesOnly=yes -o Port=22 -o IdentityFile="C:\Users\dow184\.docker\machine\machines\gitlab\id_rsa" debian@43.240.97.7:~/test .
test            

@unipark00

I faced same problem. (windows10 home, docker toolbox)
I tried to test scp command, but it failed.

$ docker version
Client:
 Version:       18.02.0-ce
 API version:   1.35 (downgraded from 1.36)
 Go version:    go1.9.4
 Git commit:    fc4de447b5
 Built: Mon Feb 12 19:03:38 2018
 OS/Arch:       windows/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      17.12.1-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   7390fc6
  Built:        Tue Feb 27 22:20:43 2018
  OS/Arch:      linux/amd64
  Experimental: false
$ pwd
/c/Users/Jungho/dockerws

$ ls -al
total 30
drwxr-xr-x 1 Jungho 197121    0 3월  12 21:46 ./
drwxr-xr-x 1 Jungho 197121    0 3월  12 21:42 ../
-rw-r--r-- 1 Jungho 197121  390 3월  12 21:17 docker.cow
-rw-r--r-- 1 Jungho 197121  511 3월  12 21:34 Dockerfile
-rw-r--r-- 1 Jungho 197121  569 3월  12 22:00 nginx.conf
-rw-r--r-- 1 Jungho 197121 2723 3월  12 21:46 nginx.conf.invalid

$ docker-machine scp /c/Users/Jungho/dockerws/nginx.conf default:/home/docker
Error loading host: Error loading host: Docker machine "C" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one.

How should I get solved??

@toby-howell

@SvenDowideit Your log shows that Machine is passing C:Program FilesGitusrbinscp.exe as the first argument to scp. I see the same, and confirmed it with Process Monitor:

image

$ docker-machine --version
docker-machine.exe version 0.14.0, build 89b8332

This happens with and without localhost:.

@jgilfoil

Same problem. Windows 10 using docker quick start terminal

Jason@Forge MINGW64 /d/Minikube/code
$ docker-machine --version
docker-machine.exe version 0.14.0, build 89b8332

$ docker-machine scp docker-media:/home/docker/plexserver.log localhost:/d/Minikube/.
cp: cannot stat 'FilesGitusrbinscp.exe': No such file or directory
ssh: Could not resolve hostname c: Name or service not known
cp: cannot stat 'FilesGitusrbinscp.exe': No such file or directory
cp: cannot stat '-o': No such file or directory
cp: cannot stat 'StrictHostKeyChecking=no': No such file or directory
cp: cannot stat '-o': No such file or directory
cp: cannot stat 'UserKnownHostsFile=/dev/null': No such file or directory
cp: cannot stat '-o': No such file or directory
cp: cannot stat 'LogLevel=quiet': No such file or directory
cp: cannot stat '-3': No such file or directory
cp: cannot stat '-o': No such file or directory
cp: cannot stat 'IdentitiesOnly=yes': No such file or directory
cp: cannot stat '-o': No such file or directory
cp: cannot stat 'Port=63735': No such file or directory
cp: cannot stat '-o': No such file or directory
ssh: Could not resolve hostname identityfile=d: Name or service not known
ssh: connect to host 127.0.0.1 port 22: Connection refused
exit status 1

@CollinChaffin

Over a year later this is still broken today.

@efrecon

Well, as nobody seems to be putting some effort into docker-machine, this is not likely to be fixed any time soon.

@bakoontz

Still broken as of version 0.16.1, build cce350d.

However, a kludge of a workaround:

dm -D scp app.jar docker@default:/home/docker/app.jar
...
{C:cygwin64binscp.exe [C:cygwin64binscp.exe -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -3 -o IdentitiesOnly=yes -o Port=55718 -o IdentityFile="C:\Users\.docker\machine\machines\default\id_rsa" app.jar docker@127.0.0.1:/home/docker/app.jar] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> <nil> false [] [] [] [] <nil> <nil>}
ssh: Could not resolve hostname c: Name or service not known
...

Copy the command inside of the square brackets, then paste it to your command-line and run. This works in cygwin’s terminal window (if you replace all that silly backslash stuff in the scp.exe command with simply scp). I can’t vouch for other terminals/setups.

There is obviously quite a bit of confusion as to how to make this work properly. Since I don’t know Go, I don’t have much to contribute other than this interim solution.

@arikw

As a workaround, you can run a scp command and provide the Docker machine’s ip and private key, like so:

MYSYS_NO_PATHCONV=1 scp -i $MACHINE_STORAGE_PATH/machines/$DOCKER_MACHINE_NAME/id_rsa 
root@$(docker-machine ip $DOCKER_MACHINE_NAME):/tmp/my-backup.zip 
/S/data/backup/backup_$(date +%Y%m%d_%H%M%S).zip

Works using git bash’s scp command.

@FrankFang

If you want to cope files from container to local (in Windows), you can

  1. share /d with vm
  2. docker-machine ssh; then copy files to /d/xxx
  3. exit; then you can see files in Windows /d/xxx

Понравилась статья? Поделить с друзьями:
  • Horizon zero down критическая ошибка
  • Horizon zero dawn пишет ошибку
  • Horizon zero dawn ошибка произошел критический сбой игры
  • Horizon zero dawn ошибка при установке
  • Horizon zero dawn ошибка save game failed