0

How to use single public key for multiple hosts do i need to duplicate the entries in authorized_keys? or is there a way to do it as single configuration?

For example: Key user@host1 user@host2 user@host3

1
  • You could generate a key pair, put the public key in the server's authorized_keys and share the private key with all your clients. May 14, 2014 at 7:58

1 Answer 1

0

In /home/user/.ssh/authorized_keys on the server to be accessed remotely, enter the public key (in Ubuntu, contents of /home/user/.ssh/id_rsa.pub) for the device the user will be logging in from. This will need to be repeated for all additional servers that it is desired for the user to log in to.

If the user has more than one device used to access the server, then there should be a public key for each device, with each public key on its own line in /home/user/.ssh/authorized_keys.

3
  • The requirement is to use single public/private key pair to multiple system(cluster) to access a single system. Is there way to achieve it or do we need to generate separate key pairs for each system in cluster?
    – sanjeev
    May 15, 2014 at 4:47
  • There is no technical requirement for each client to have its own private key, just keep in mind that if one client is compromised, then a new private key must be distributed to all clients.
    – Paul
    May 15, 2014 at 5:24
  • So we can have a same public key for different hosts in authorized_keys. That's what i take from here. I will try with that. Thanks!
    – sanjeev
    May 15, 2014 at 5:33

You must log in to answer this question.

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