Let's say in my computer running Debian i have an RSA key pair generated by user foo and copied the public key to server_A for allowing key based authentication in ssh for foo.

Now my question is can i use the same key-pair for user bar and loo to allow key based authentication for them on server_A or do i need to create a separate key pair for each user?

1 Answer 1


If you don't care about security, you can do that.

Otherwise, you absolutely need a different key pair for each user. If multiple users share the same private key, they can easily impersonate each other. If you're only doing key authentication (no passwords) then they can log into each other's accounts.

  • but if the OP is ok with that, can it be possible?
    – schroeder
    Commented Feb 25, 2015 at 0:16
  • 1
    It's possible to do that, but it defeats the purpose of key authentication. Commented Feb 25, 2015 at 0:17
  • @JustinLardinois: If i want to do so then copying the public key to the server for all users and private key to all users home should do, right?
    – ramel
    Commented Feb 25, 2015 at 0:26
  • I guessed the OP was ok with that ..... :)
    – schroeder
    Commented Feb 25, 2015 at 0:28
  • 2
    if you do that, foo can ssh into bar's account by doing ssh bar@server_A. You might as well create a single user and ask foo, bar and loo to use the same user account. Commented Feb 25, 2015 at 1:54

You must log in to answer this question.

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