I'm wonder if is possible to authenticate the same user with different public-private keys pairs on the same remote host.

For all production servers, the public-private key pair has been generated for the same user and then exported to the backup server for allowing ssh authentication without human intervention.

However, I'm having problems on some production servers, once the password prompt is always displayed.

Thanks in advance for the help, Best regards!

  • Try running ssh on the backup machines by hand, with -v. Post the output. ssh has no problems accepting multiple public keys or the same private key from multiple places. – Steven Feb 8 '11 at 0:21

I think you're aksing the wrong question. SSH refusing to use a keyfile is a symptom of incorrect permissions on a user's ~/.ssh/; it should be 0700 and the contents should be 0600 for private keys.

That being said, OpenSSH will accept any key in the ~/.ssh/authorized_keys file - simply cat my_other_key.pub >> ~/.ssh/authorized_keys or if you have it available, ssh-copy-id will simplify this as well as setting the permissions correctly.

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.