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.


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

  • 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 Apr 7, 2013 at 20:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .