MAAS SSH 密钥无效

MAAS SSH 密钥无效

我想使用 Ubuntu 12.04 为 OpenStack 设置 MAAS。

一切运行良好:

marcel@ubuntu20:~$ juju status
2012-07-09 13:00:02,559 INFO Connecting to environment...
The authenticity of host 'node1 (10.110.11.71)' can't be established.
ECDSA key fingerprint is 29:42:2c:7a:ef:52:d4:f8:63:51:d8:a1:1e:a9:16:0e.
Are you sure you want to continue connecting (yes/no)? yes
2012-07-09 13:00:05,883 ERROR Invalid SSH key

我读到其他人也遇到了这个问题,不确定这是否是一个 BUG,但我找不到可行的解决方案...

我读这篇帖子有同样的问题

我向此文件添加了一个根用户,以便可以访问节点:

/var/lib/cobbler/kickstarts/maas.preseed:

现在我可以访问节点,我创建了一个ubuntu有密码的用户并复制了密钥。

我认为现在它看起来好一点了。

marcel@ubuntu20:~$ juju status
2012-07-09 15:43:12,130 INFO Connecting to environment...
Warning: the ECDSA host key for 'node1' differs from the key for the IP address '10.110.11.71'
Offending key for IP in /home/marcel/.ssh/known_hosts:1
Matching host key in /home/marcel/.ssh/known_hosts:8
Are you sure you want to continue connecting (yes/no)? yes

仔细观察后我发现了这个问题:

marcel@ubuntu20:~$ juju -v status
2012-07-09 15:36:49,458 DEBUG Initializing juju status runtime
2012-07-09 15:36:49,469 INFO Connecting to environment...
2012-07-09 15:36:49,588 DEBUG Connecting to environment using node1...
2012-07-09 15:36:49,589 DEBUG Spawning SSH process with remote_user="ubuntu" remote_host="node1" remote_port="2181" local_port="43964".
Warning: the ECDSA host key for 'node1' differs from the key for the IP address '10.110.11.71'
Offending key for IP in /home/marcel/.ssh/known_hosts:1
Matching host key in /home/marcel/.ssh/known_hosts:8
Are you sure you want to continue connecting (yes/no)? yes
2012-07-09 15:36:53,098:16474(0x7f0c16d58700):ZOO_INFO@log_env@658: Client environment:zookeeper.version=zookeeper C client 3.3.5
2012-07-09 15:36:53,098:16474(0x7f0c16d58700):ZOO_INFO@log_env@662: Client environment:host.name=ubuntu20
2012-07-09 15:36:53,098:16474(0x7f0c16d58700):ZOO_INFO@log_env@669: Client environment:os.name=Linux
2012-07-09 15:36:53,098:16474(0x7f0c16d58700):ZOO_INFO@log_env@670: Client environment:os.arch=3.2.0-23-generic
2012-07-09 15:36:53,098:16474(0x7f0c16d58700):ZOO_INFO@log_env@671: Client environment:os.version=#36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012
2012-07-09 15:36:53,099:16474(0x7f0c16d58700):ZOO_INFO@log_env@679: Client environment:user.name=marcel
2012-07-09 15:36:53,099:16474(0x7f0c16d58700):ZOO_INFO@log_env@687: Client environment:user.home=/home/marcel
2012-07-09 15:36:53,099:16474(0x7f0c16d58700):ZOO_INFO@log_env@699: Client environment:user.dir=/home/marcel
2012-07-09 15:36:53,099:16474(0x7f0c16d58700):ZOO_INFO@zookeeper_init@727: Initiating client connection, host=localhost:43964 sessionTimeout=10000 watcher=0x7f0c14b886b0 sessionId=0 sessionPasswd=<null> context=0x367e940 flags=0
2012-07-09 15:36:53,100:16474(0x7f0c118e2700):ZOO_INFO@check_events@1585: initiated connection to server [127.0.0.1:43964]
2012-07-09 15:36:53,100:16474(0x7f0c118e2700):ZOO_ERROR@handle_socket_error_msg@1603: Socket [127.0.0.1:43964] zk retcode=-4, errno=112(Host is down): failed while receiving a server response
2012-07-09 15:36:56,434:16474(0x7f0c118e2700):ZOO_ERROR@handle_socket_error_msg@1579: Socket [127.0.0.1:43964] zk retcode=-4, errno=111(Connection refused): server refused to accept the client
2012-07-09 15:36:59,770:16474(0x7f0c118e2700):ZOO_ERROR@handle_socket_error_msg@1579: Socket [127.0.0.1:43964] zk retcode=-4, errno=111(Connection refused): server refused to accept the client
2012-07-09 15:37:03,107:16474(0x7f0c118e2700):ZOO_ERROR@handle_socket_error_msg@1579: Socket [127.0.0.1:43964] zk retcode=-4, errno=111(Connection refused): server refused to accept the client
2012-07-09 15:37:06,443:16474(0x7f0c118e2700):ZOO_ERROR@handle_socket_error_msg@1579: Socket [127.0.0.1:43964] zk retcode=-4, errno=111(Connection refused): server refused to accept the client
2012-07-09 15:37:09,779:16474(0x7f0c118e2700):ZOO_ERROR@handle_socket_error_msg@1579: Socket [127.0.0.1:43964] zk retcode=-4, errno=111(Connection refused): server refused to accept the client
2012-07-09 15:37:13,116:16474(0x7f0c118e2700):ZOO_ERROR@handle_socket_error_msg@1579: Socket [127.0.0.1:43964] zk retcode=-4, errno=111(Connection refused): server refused to accept the client
2012-07-09 15:37:16,452:16474(0x7f0c118e2700):ZOO_ERROR@handle_socket_error_msg@1579: Socket [127.0.0.1:43964] zk retcode=-4, errno=111(Connection refused): server refused to accept the client
2012-07-09 15:37:19,589 DEBUG Retrying connection: Cannot connect to environment using node1 (perhaps still initializing): could not connect before timeout after 1 retries
2012-07-09 15:37:19,708 DEBUG Connecting to environment using node1...
2012-07-09 15:37:19,708 DEBUG Spawning SSH process with remote_user="ubuntu" remote_host="node1" remote_port="2181" local_port="60742".
Warning: the ECDSA host key for 'node1' differs from the key for the IP address '10.110.11.71'
Of

答案1

使用 Juju 部署时,您不必手动添加 SSH 密钥。部署阶段可能会出现许多问题(我们正在向后移植一些修复程序以缓解这些问题)。您能否在此处查看https://answers.launchpad.net/maas/+faqs并查看前两个常见问题是否适用。

答案2

似乎 Juju 想要使用 MaaS 用户“root”,而不是其他指定用户 -请注意,我尚未尝试重复该错误来确认......

我在第一次测试推出(2013 年 3 月 11 日)时收到了无效的 SSH 密钥消息 - 检查了上面列出的时间问题但无济于事。

在初始 MaaS 安装中,我创建了一个名为 root 以外的 MaaS 用户,然后安装了 JuJu,并尝试让 JuJu 绕过这个错误 -

为了解决无效的 SSH 密钥问题,我在 MaaS 中创建了一个名为“root”的用户,然后:

sudo ssh-keygen -t rsa到文件夹 ~/.ssh/id_rsa (/home/MyUbuntuLoginName/.ssh/id_rsa - 不是 /root/.ssh/id_rsa 的 sudo 默认值)

chmod 777 ~/.ssh/(不确定这是否有必要——显然不安全)

sudo cat ~/.ssh/id_rsa.pub并将 MaaS web gui 中的结果复制到 root/preferences/add ssh key

将 root 的 MaaS 密钥复制到 /home/MyUbuntuLoginName/environment.yaml 文件中

sudo juju bootstrap- 等待(可能要很长时间)机器上线

sudo juju status

yes出现提示时输入接受证书

成功!

再次,我没有重复该问题来确认这是根本原因......

微点

相关内容