docker-machine create不断要求输入密码

问题描述 投票:0回答:1

我正在尝试像这样将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个回答
0
投票

此问题的原因是/.ssh/config的顺序。

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

我在最后移动了通配符条目,现在不再要求输入密码,并且问题已解决。

我如何帮助某人。

© www.soinside.com 2019 - 2024. All rights reserved.