Autenticação RSA do Ubuntu 9.10: ssh falha, o filezilla roda bem

3

Isso é um mistério para mim. Eu geralmente uso autenticação RSA sem senha para acessar meus servidores remotos * nix com ssh e sftp. Nunca tive qualquer problema até agora.

Não consigo me conectar a uma máquina Ubuntu 9.10:

user@myclient$ ssh -i .ssh/Ganymede_key [email protected]
[...]
debug1: Host 'ganymede.server.com' is known and matches the RSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:14
debug2: bits set: 494/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: .ssh/Ganymede_key (0xb96a0ef8)
debug2: key: .ssh/Ganymede_key ((nil))
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: .ssh/Ganymede_key
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: .ssh/Ganymede_key
debug1: read PEM private key done: type RSA
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug2: we did not send a packet, disable method
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1

Em seguida, ele volta para a autenticação por senha. Se eu desabilitar a autenticação de senha na máquina remota, minha tentativa de conexão simplesmente falhará com uma "Permissão negada (publickey)". estado.

Mesma coisa para o sftp na linha de comando.

A coisa "engraçada" é que exatamente a mesma chave RSA funciona como um encanto com uma sessão sftp do Filezilla:

12:08:00 Trace: Offered public key from "/home/user/.filezilla/keys/Ganymede_key"
12:08:00 Trace: Offer of public key accepted, trying to authenticate using it.
12:08:01 Trace: Access granted
12:08:01 Trace: Opened channel for session
12:08:01 Trace: Started a shell/command
12:08:01 Status: Connected to ganymede.server.com
12:08:02 Trace: CSftpControlSocket::ConnectParseResponse()
12:08:02 Trace: CSftpControlSocket::ResetOperation(0)
12:08:02 Trace: CControlSocket::ResetOperation(0)
12:08:02 Status: Retrieving directory listing...
12:08:02 Trace: CSftpControlSocket::SendNextCommand()
12:08:02 Trace: CSftpControlSocket::ChangeDirSend()
12:08:02 Command: pwd
12:08:02 Response: Current directory is: "/root"
12:08:02 Trace: CSftpControlSocket::ResetOperation(0)
12:08:02 Trace: CControlSocket::ResetOperation(0)
12:08:02 Trace: CSftpControlSocket::ParseSubcommandResult(0)
12:08:02 Trace: CSftpControlSocket::ListSubcommandResult()
12:08:02 Trace: CSftpControlSocket::ResetOperation(0)
12:08:02 Trace: CControlSocket::ResetOperation(0)
12:08:02 Status: Directory listing successful

Alguma opinião?

M

    
por MariusPontmercy 08.02.2010 / 12:43

2 respostas

1

Seu primeiro traço parece um pouco estranho. Como jneves aponta, o ssh assume que o arquivo contém suas chaves públicas e privadas. A documentação diz que a "identidade" é a chave privada.

 -i identity_file
         Selects a file from which the identity (private key) for RSA or DSA authentication is
         read.

Se você realmente tem duas chaves em um arquivo (não tinha ideia de que é possível), você provavelmente deveria separá-las. De qualquer forma, parece que você não está de acordo com a documentação.

    
por 08.06.2011 / 20:23
0

exclua seu arquivo de hosts conhecidos em .ssh em sua pasta pessoal e isso pode funcionar.

    
por 08.02.2010 / 12:47