SSH: Permissão negada no Cygwin, funciona em Putty

0

Eu estou tentando SSH em um servidor, onde eu não tem privilégios de root. Eu não gosto de usar o Putty, eu prefiro o Cygwin. Eu posso entrar no servidor usando Putty, mas usando exatamente a mesma chave privada e digitando exatamente a mesma senha, recebo um erro usando o Cygwin. Eu tentei isso com e sem a força da versão 2 do SSH, e com e sem a opção de encaminhamento de porta. Mesmo resultado. Também tentei apagar o host do meu arquivo known_hosts, mesmo resultado.

Veja abaixo. Endereço IP alterado para segurança.

$  ssh -v -2 -i private_key.ppk -L 5432:localhost:5432 [email protected]

Connecting to 22.22.22.22
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Connecting to 22.22.22.22 [22.22.22.22] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/private_key.ppk type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/private_key.ppk-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to 22.22.22.22:22 as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client [email protected] <implicit> none
debug1: kex: client->server [email protected] <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:T1wfSekfyPulNsBaGn/d5ubEKy1VKWKmBcr/SQQTRSs
debug1: Host '22.22.22.22' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:58
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: /home/user/.ssh/private_key.ppk
Enter passphrase for key '/home/user/.ssh/private_key.ppk':
Enter passphrase for key '/home/user/.ssh/private_key.ppk':
Enter passphrase for key '/home/user/.ssh/private_key.ppk':
debug1: No more authentication methods to try.
Permission denied (publickey).

A parte "debug1: key_load_public: No such file or directory" pode ser. Mas, novamente, posso usar SSH neste servidor com Putty usando a mesma chave privada, então minha chave no servidor deve estar no lugar.

    
por rshaq 03.10.2015 / 23:18

2 respostas

2

O formato do arquivo ppk é específico do PuTTY. Eu acho que você precisa convertê-lo para um formato geral. Você pode usar puttegen.exe para fazer isso.

    
por 03.10.2015 / 23:26
0

Com o cygwin, você pode usar ssh-keygen para fazer uma chave

E você poderia usar o comando 'cat' e talvez o comando 'file', para examinar a chave e verificar o formato também. Aparentemente, há uma carga de formatos-chave.

    
por 03.10.2015 / 23:28