EDIT: Alterado o nome das chaves ssh para id_rsa, ainda com problemas.

EDIT: Alterado o nome das chaves ssh para id_rsa, ainda com problemas.

Tentei configurar chaves públicas e privadas em dois computadores (clementine e cfmi) para poder fazer ssh entre eles sem usar senha. No entanto, ainda estou sendo solicitada uma senha, apesar da inclusão da chave pública no arquivo de chaves autorizadas em ~/.ssh.

Posso fazer login no servidor cfmi quando tento me conectar a partir do clementine, mas minha senha é solicitada.

Também pode ser relevante que eu deva primeiro me conectar a uma rede VPN usando o Cisco AnyConnect e só então posso fazer ssh no cfmi, já que ele tem firewall.

No entanto, quando tento me conectar do servidor cfmi ao clementine, uma senha é solicitadaque não corresponde à senha rootEu tenho naquele computador. Portanto, não consigo fazer logon do cfmi para o clementine.

Fica ainda mais misterioso... A senha root funciona perfeitamente quando estou fazendo ssh do meu iphone na rede local.

Alguém pode me ajudar a descobrir como fazer as chaves funcionarem e como redefinir minha senha para ssh no Clementine?

EDIT: Alterado o nome das chaves ssh para id_rsa, ainda com problemas.

Aqui está o conteúdo de .ssh no cliente (cfmi):

-rwx------. 1 se394 mriusers 1634 Sep 29 22:00 authorized_keys
-rwx------. 1 se394 mriusers 1633 Sep 29 22:00 authorized_keys~
-rw-------. 1 se394 mriusers 1675 Sep 29 21:17 clementine
-rw-r--r--. 1 se394 mriusers  415 Sep 28 19:52 clementine.pub
-rw-------. 1 se394 mriusers 1679 Sep 29 22:04 id_rsa
-rw-r--r--. 1 se394 mriusers  415 Sep 29 22:04 id_rsa.pub
-rw-r--r--. 1 se394 mriusers 1830 Sep 28 20:15 #known_hosts#
-rw-r--r--. 1 se394 mriusers 1043 Sep 29 00:13 known_hosts
-rw-r--r--. 1 se394 mriusers 1837 Sep 28 17:41 known_hosts~

E aqui está a saída detalhada para cfmi conectando-se ao clementine

se394 ~ $ ssh -v -v -v [email protected]
OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 51: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to clementine.duckdns.org [162.211.160.162] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/exports/home/se394/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /exports/home/se394/.ssh/id_rsa type 1
debug1: identity file /exports/home/se394/.ssh/id_rsa-cert type -1
debug1: identity file /exports/home/se394/.ssh/id_dsa type -1
debug1: identity file /exports/home/se394/.ssh/id_dsa-cert type -1
debug1: identity file /exports/home/se394/.ssh/id_ecdsa type -1
debug1: identity file /exports/home/se394/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.4
debug1: Remote protocol version 2.0, remote software version Cisco-1.25
debug1: no match: Cisco-1.25
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "clementine.duckdns.org" from file "/exports/home/se394/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /exports/home/se394/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],ssh-rsa,[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug2: dh_gen_key: priv key bits set: 130/256
debug2: bits set: 509/1024
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 21:f7:7a:59:f5:ef:03:1f:ee:99:23:b8:f1:c1:71:b4
debug3: load_hostkeys: loading entries for host "clementine.duckdns.org" from file "/exports/home/se394/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /exports/home/se394/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "162.211.160.162" from file "/exports/home/se394/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /exports/home/se394/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'clementine.duckdns.org' is known and matches the RSA host key.
debug1: Found key in /exports/home/se394/.ssh/known_hosts:3
debug2: bits set: 496/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: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /exports/home/se394/.ssh/id_rsa (0x7f052168bf10),
debug2: key: /exports/home/se394/.ssh/id_dsa ((nil)),
debug2: key: /exports/home/se394/.ssh/id_ecdsa ((nil)),
debug1: Authentications that can continue: password
debug3: start over, passed a different list password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup password
debug3: remaining preferred: ,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
[email protected]'s password:

Verifiquei o arquivo autorizado_keys no servidor e a chave corresponde a id_rsa.pub. Alguém tem alguma dica de como proceder a partir daqui?

Responder1

Você não deveria ter renomeado seu arquivo de chave privada ( id_rsa) sem configurá-lo sshpara saber quais outros nomes de arquivo ele deveria procurar ao procurar por chaves privadas.

informação relacionada