OS : CentOS5

node 1 : sandbox1.local node 2 : sandbox2.local

The nodes have the hostnames in the hots file. Pinging to each other works fine.


My home is mounted from sandbox1.local:/home/%u/ to sandbox2.local:/home/%u/. I want to establish passwordless login with this shared home directory. The usernames are the same e.g. sandbox on both of the nodes. When the home folder is unmounted on sandbox2.local all works fine. When it is mounted via nfs from sandbox1.local:/home/%u/ to sandbox2.local:/home/%u/ the passwordless login fails and asks for a password.

Does anyone have an idea how to acieve this with a shared home via NFS?

The debug output seems different:

debug2: key: /home/zandbak/.ssh/identity ((nil))
debug2: key: /home/zandbak/.ssh/id_rsa (0x9f4ce60)
debug2: key: /home/zandbak/.ssh/id_dsa ((nil))
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/zandbak/.ssh/identity
debug3: no such identity: /home/zandbak/.ssh/identity
debug1: Offering public key: /home/zandbak/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/zandbak/.ssh/id_dsa
debug3: no such identity: /home/zandbak/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
  • Are you using automount to mount your home directory? – John Feb 5 '15 at 20:22
  • The home dir is mounted via fstab. – Dany Feb 5 '15 at 20:24
  • Does passwordless login work on sandbox1 ? – John Feb 5 '15 at 20:25
  • From sandbox2 to sandbox1? – Dany Feb 5 '15 at 20:25
  • From whereever you are attempting to log in to sandbox2 from. – John Feb 5 '15 at 20:26

I think this will work, given your comments above:

sandbox1$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

Then ensure the NFS mount is active from 1 to 2. You should then be able to login from 1 to 2 and vice-versa without passwords. You may have to use id_rsa.pub or authorized_keys2 depending on your specific setup.

  • I am really trying to get this to work, but i cannot make it work like this. Would it also work if i change the locations in sshd_config entirely? To something like /var/$u/.ssh/* and copy over the files – Dany Feb 5 '15 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.