Não é possível ssh sem senha para algumas máquinas, em um sistema de arquivos compartilhado em um cluster, enquanto ele é bem-sucedido em outras máquinas

1

Estou executando em um cluster, onde meu diretório pessoal é compartilhado em todas as máquinas. Algumas das máquinas são RHEL e as outras são Ubuntu.

Quando eu faço o login sem senha do RHEL- > RHEL ou UBUNTU- > RHEL é bem-sucedido. No entanto, quando eu tento qualquer coisa- > UBUNTU, ele falha e eu preciso digitar manualmente a senha.

EDIT1: Falha apenas ao tentar se conectar a algumas máquinas Ubuntu. Conectar-se a outras máquinas Ubuntu é bem sucedido.

Confirmei a configuração de ~ e ~/.ssh a chmod 700 e authorized_keys a chmod 600 , mas isso não ajudou.

EDIT2: adicionei abaixo a saída de namei -lx ~/.ssh/authorized_keys

EDIT3: Eu adicionei abaixo a saída de ssh no modo de depuração em uma máquina para a qual tenho sudo. Surpreendentemente (embora acima), diz Authentication refused: bad ownership or modes for file /home/lab/my_user/.ssh/authorized_keys .

Eu apaguei e recriou as chaves ssh, e também foi sem sucesso (ssh para máquinas não-sudo ainda funciona, ssh para com-sudo não funciona). Os comandos que usei foram:

ssh-keygen -t rsa
ssh-copy-id -i id_rsa.pub ubuntu_machine_name

Aqui está a saída ao fazer ssh -vv host

[my_user@ctx01 .ssh]$ ssh -vv 10.20.30.40
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options or *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.20.30.40 [10.20.30.40] port 22.
debug1: Connection established.
debug1: identity file /home/lab/my_user/.ssh/identity type -1
debug1: identity file /home/lab/my_user/.ssh/identity-cert type -1
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug2: key_type_from_name: unknown key type '-----END'
debug1: identity file /home/lab/my_user/.ssh/id_rsa type 1
debug1: identity file /home/lab/my_user/.ssh/id_rsa-cert type -1
debug1: identity file /home/lab/my_user/.ssh/id_dsa type -1
debug1: identity file /home/lab/my_user/.ssh/id_dsa-cert type -1
debug1: identity file /home/lab/my_user/.ssh/id_ecdsa type -1
debug1: identity file /home/lab/my_user/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: 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],[email protected],[email protected],ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,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,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[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: [email protected],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: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[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],[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]
debug2: kex_parse_kexinit: none,[email protected]
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-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
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
debug2: dh_gen_key: priv key bits set: 130/256
debug2: bits set: 480/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '10.20.30.40' is known and matches the RSA host key.
debug1: Found key in /home/lab/my_user/.ssh/known_hosts:1
debug2: bits set: 519/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-my_userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/lab/my_user/.ssh/identity ((nil))
debug2: key: /home/lab/my_user/.ssh/id_rsa (0x7f412fd53880)
debug2: key: /home/lab/my_user/.ssh/id_dsa ((nil))
debug2: key: /home/lab/my_user/.ssh/id_ecdsa ((nil))
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/lab/my_user/.ssh/identity
debug1: Offering public key: /home/lab/my_user/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/lab/my_user/.ssh/id_dsa
debug1: Trying private key: /home/lab/my_user/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
[email protected]'s password:

Aqui está a saída de namei -lx ~/.ssh/authorized_keys

f: /home/lab/my_user/.ssh/authorized_keys
Drwxr-xr-x root   root    /
drwxr-xr-x root   root    home
Drwxr-xr-x nobody nogroup lab
drwx------ nobody nogroup my_user
drwx------ nobody nogroup .ssh
-rw------- nobody nogroup authorized_keys

Aqui está a saída de ssh no modo de depuração:

debug1: userauth-request for user my_user service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: test whether pkalg/pkblob are acceptable [preauth]
debug1: temporarily_use_uid: 2117/505 (e=0/0)
debug1: trying public key file /home/lab/my_user/.ssh/authorized_keys
debug1: fd 4 clearing O_NONBLOCK
Authentication refused: bad ownership or modes for file /home/lab/my_user/.ssh/authorized_keys
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 2117/505 (e=0/0)
debug1: trying public key file /home/lab/my_user/.ssh/authorized_keys2
debug1: Could not open authorized keys '/home/lab/my_user/.ssh/authorized_keys2': No such file or directory
debug1: restore_uid: 0/0
Failed publickey for my_user from 10.20.30.40 port 48718 ssh2: RSA 90:42:ea:e3:79:b2:27:67:49:1b:17:0b:db:b6:ad:eb
    
por Yuval Atzmon 05.02.2016 / 18:28

1 resposta

2

O problema estava relacionado ao fato de que o NFS não estava configurado corretamente nas máquinas Ubuntu. Quando eu fiz ls -l , o proprietário e o grupo do arquivo eram nobody nogroup . Depois que eu consertei a configuração do NFS, tudo correu bem.

    
por Yuval Atzmon 07.02.2016 / 14:10