Não é possível fazer login na VM do Azure executando Linux no OS X

Não é possível fazer login na VM do Azure executando Linux no OS X

Estou tentando fazer login em uma VM executando Ubuntu no Azure a partir do OS X por meio de verificação SSH. Mas quando tento conectar-me à máquina virtual, recebo um erro de permissão negada (chave pública).

Para criar o certificado do par de chaves fiz isso através do terminal seguindo os seguintes passos:

openssl req -x509 -nodes -days 365 \
-newkey rsa:2048 \
-keyout example1.key \
-out example1.pem

Então eu defino as permissões:

chmod 600 example1.key

Ambos os arquivos estão na minha pasta de usuário.

Durante a criação da VM fiz upload do arquivo example1.pem.

Após criar a VM, tento conectar usando o seguinte comando:

ssh -v -i myPrivateKey.key -p 22 [email protected]

Esta é a saída que recebo:

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to ubuntuedx.cloudapp.net [23.99.90.218] port 22.
debug1: Connection established.
debug1: identity file myPrivateKey.key type -1
debug1: identity file myPrivateKey.key-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH_5*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 20:b6:58:2c:96:75:f8:f6:b0:25:39:85:ed:ab:7a:9d
debug1: Host 'ubuntuedx.cloudapp.net' is known and matches the RSA host key.
debug1: Found key in /Users/juanse/.ssh/known_hosts:4
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: myPrivateKey.key
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

Tentei usar o VIP em vez do nome da VM, mas obtive a mesma saída. Procurei em toda a Internet uma resposta sobre o que está acontecendo aqui, mas não encontrei soluções para o meu problema.

Responder1

Devo perguntar, pois não foi informado. Você adicionou sua chave pública durante a criação da VM? Há uma etapa em que você carrega example1.pem e ele é armazenado no arquivo ~/.ssh/authorized_keys do usuário durante a instalação.

informação relacionada