Azure acs ssh 登录一直失败 "permission denied (public key)"

Azure acs ssh login keeping failing with "permission denied (public key)"

我已经使用文章 deploy an container service cluster 在 Azure 容器服务上成功部署了一个 mesos 集群。我在 OS X 上使用 azure cli 创建集群。作为该过程的一部分,我创建了一个新的 ssh 密钥对:

ssh-keygen -t rsa -b 2048 

部署成功后,我尝试 ssh into the end point 但收到“权限被拒绝(Public 密钥)”

 ssh -L 80:localhost:80 -N azureuser@xyz.eastus2.cloudapp.azure.com -p 2200 -v

冗长[不是全部,只有最后几行]

debug1: Host '[xyz.eastus2.cloudapp.azure.com]:2200' is known and matches the RSA host key.
debug1: Found key in /var/root/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /var/root/.ssh/id_rsa
debug1: Trying private key: /var/root/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).

我不记得在创建 ssh 密钥时有任何问题,但可能是我错过的东西,只是不确定它是什么。

我没有使用本地端口转发,以下对我有用:ssh -i /<path>/id_rsa username@masteralias.westus.cloudapp.azure.com -p 2200 -v

此外,如果您尝试使用 https://github.com/Azure/azure-quickstart-templates/tree/master/101-acs-mesos 创建集群,在参数屏幕中您将被告知以下关于密钥的信息(在工具提示中)“使用​​ SSH RSA 配置所有 linux 机器 public 密钥字符串。你的密钥应该 包括三个部分,例如 'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm" 。因此请确保您的密钥包含上述的 3 个部分