Após gerar uma nova chave privada ssh ( id_rsa
) em um servidor e distribuí-la por uma rede de servidores, um servidor não está conseguindo usar a nova chave e retorna à autenticação de senha.
Copiar o id_rsa para um novo arquivo e usá-lo funciona.
$ ssh -i id_rsa user@server
user@server's password:
$ cp id_rsa id_rsa.copy
$ chmod --reference=id_rsa id_rsa.copy
$ ssh -i id_rsa.copy user@server
Last login: Wed Apr 2 06:30:36 2014 from otherhost
[user@server ~]$
Executando ssh -vvv
debug:
id_rsa:
debug3: Not a RSA1 key file id_rsa.
...
debug1: identity file id_rsa type 1
...
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
id_rsa.copy:
debug3: Not a RSA1 key file id_rsa.copy.
...
debug1: identity file id_rsa.copy type -1
...
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: id_rsa.copy
debug1: read PEM private key done: type RSA
debug3: sign_and_send_pubkey
debug2: we sent a publickey packet, wait for reply
debug1: Authentication succeeded (publickey).
Portanto, por algum motivo, o OpenSSH está lidando com os arquivos-chave de maneira diferente. Mas por quê?