ssh-copy-id não funciona

2

Eu sei que esse problema já foi discutido. Eu olhei para os outros tópicos, e não encontrei uma pergunta com o mesmo problema, espero que você possa me ajudar ...

I SSH de userA @ hostA para userB @ hostB . Ambos os hosts usam o mesmo sistema de arquivos, o que significa que a casa do usuário A é a mesma em hostA e hostB, e o mesmo acontece com a casa do usuárioB.

Agora, eu queria salvar a chave no diretório .ssh do B, para que eu pudesse acessar do A @ A para o B @ B sem uma senha, então fiz o seguinte no userA @ hostA:

ssh-keygen -t rsa -b 2048
ssh-copy-id -i ~/.ssh/id_rsa userB@hostB
echo $? ### output was 0, meaning it was successfull    
ssh -v userB@hostB   

E recebi a seguinte saída:

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to hostB [100.100.100.100] port 22.
debug1: Connection established.
debug1: identity file /home/userA/.ssh/identity type -1
debug1: identity file /home/userA/.ssh/identity-cert type -1
debug1: identity file /home/userA/.ssh/id_rsa type 1
debug1: identity file /home/userA/.ssh/id_rsa-cert type -1
debug1: identity file /home/userA/.ssh/id_dsa type -1
debug1: identity file /home/userA/.ssh/id_dsa-cert type -1
debug1: identity file /home/userA/.ssh/id_ecdsa type -1
debug1: identity file /home/userA/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
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: Host 'hostB' is known and matches the RSA host key.
debug1: Found key in /home/userA/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_524' not found

debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_524' not found

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_524' not found

debug1: Next authentication method: publickey
debug1: Trying private key: /home/userA/.ssh/identity
debug1: Offering public key: /home/userA/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/userA/.ssh/id_dsa
debug1: Trying private key: /home/userA/.ssh/id_ecdsa
debug1: Next authentication method: password
userB@hostB's password:

Note que eu consegui ter um acesso sem senha ao userA @ hostB, mas não ao acessar o userB ...

Alguma idéia?

Muito obrigado!

PS. algumas informações adicionais:

versão do hostA:

Linux version 2.6.32-573.7.1.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Tue Sep 22 22:00:00 UTC 2015

versão do hostB:

Linux version 2.6.32-358.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Tue Jan 29 11:47:41 EST 2013

em userB @ hostB (suponho que é isso que Jakuje quis dizer), acesso de diretórios e arquivos:

~: drwxrwx---  
~/.ssh: drwx------  
~/.ssh/authorized_keys: -rw-------
    
por Hagai Naveh 21.02.2016 / 11:02

0 respostas

Tags