Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

so I have two servers. On these servers /dev/sdb is a disk that has been used for a shared filesystem (i.e, both servers put their second harddrives "together" and now each one can use all the space as if it was local to them)

There is a user, db2inst1 that has a home directory on this shared system- I can't generate a private key file on each server and put the id_rsa.pub stuff into authorized_keys because every time ssh-keygen is run it overwrites the id_rsa files.

How can I get passwordless ssh between these two nodes? I've already tried putting the same line twice in authorized_keys- only changing the server name at the end- but this doesn't seem to work. Permissions are 600.

Ideas?

share|improve this question
    
What are the perms on the parent directories? Both ~/.ssh and ~? –  tink Apr 7 '13 at 19:52
    
700 on .ssh and 777 on ~ (yeah I know that isn't the best.) –  LainIwakura Apr 7 '13 at 20:34
    
Well there's your problem. ssh will not accept any files under ~/.ssh if ~ is even group writable. –  tink Apr 7 '13 at 20:39
    
What should the permissions be on the ~ directory? 700 as well? I just tried 755 but that didn't work either. –  LainIwakura Apr 7 '13 at 20:40

1 Answer 1

Public/private keypairs aren't tied to a hostname. The hostname you might see at the end of a public key entry is just a comment, and is ignored.

In principle, all you should need to do is add the id_rsa.pub contents into authorized_keys once. Both db2inst1 users should be reading from the corresponding id_rsa private key file, and then seeing that the associated public key is in authorized_keys.

Use ssh -v to verify that the correct private key file is being read, and that the read is successful.

share|improve this answer
    
I tried making a new key and only placing that in authorized_keys but it didn't quite workout. Here is output from ssh -v pastebin.com/KyCDJQFR –  LainIwakura Apr 7 '13 at 20:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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