【问题标题】:docker-machine create keeps asking for passworddocker-machine create 不断询问密码
【发布时间】:2020-06-27 19:37:42
【问题描述】:

我正在尝试将docker-machine create 发送到这样的 Ubuntu 16.04 主机:

    ssh-keygen -R ${remote_host}
    ssh-copy-id -i ~/.ssh/id_host_rsa.pub root@${remote_host}

    docker-machine create \
        --driver generic \
        --generic-ip-address=${remote_host} \
        --generic-ssh-key ~/.ssh/id_host_rsa \
        --generic-ssh-user=root ${machine_name}

版本信息:

docker --version
Docker version 19.03.6, build 369ce74a3c

docker-machine --version
docker-machine version 0.16.2, build bd45ab13

我反复被要求输入密码..这是为什么?

这是输出:

...

Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: ERROR: Received disconnect from 77.68.21.66 port 22:2: Too many authentication failures
ERROR: Disconnected from 77.68.21.66 port 22

Running pre-create checks...
Creating machine...
(production) Importing SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Password: 
Detecting the provisioner...
Password: 
Provisioning with ubuntu(systemd)...
Password: 

.. etc

【问题讨论】:

    标签: docker openssl docker-machine openssh


    【解决方案1】:

    这个问题的原因是~/.ssh/config的排序。

    我首先在config 中有一个Host * 条目,然后是我相应的特定服务器Host XX.XX.XX.XX 条目。

    我移动了~/.ssh/config 末尾的通配符条目,现在不再经常要求输入密码,问题现已解决。

    这对某人有什么帮助。

    【讨论】:

      猜你喜欢
      • 2015-12-15
      • 1970-01-01
      • 2018-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-19
      • 2014-11-20
      • 1970-01-01
      相关资源
      最近更新 更多