I want to generate a ssh key on a virtual server that will be in use for all users. I did created a key for myself

ssh-keygen -t rsa -C "my@gamil.com"

but it's under my user only. is there a solution for this?

  • 4
    I cannot let this be unsaid. You do understand having a single key, used by multiple people, reduces the overall security of the key and exposes it to more vectors for that key being harvested.
    – Ramhound
    Jan 21 '15 at 12:23
  • You tagged this with github. Is the key for connecting to your server or from it?
    – user1686
    Jan 21 '15 at 14:32
  • Not sure what you meant, but i think the answer is from it
    – Ohad Perry
    Jan 21 '15 at 15:53

You can give a copy of your private key file to other people. You can make it world-readable and put it in a directory where other people can access the file. ssh is perfectly happy to use a world-readable private key file.

If the key file is protected with a passphrase, you will have to give the passphrase to other users in order for them to use the key. Once they know the passphrase, they'd be able make a copy of the key file and use ssh-keygen to change or remove the passphrase on the copied file.

It's not normal or common to set up an ssh key that anyone can use. So there's no standard place to store them or standard way to distribute them to the other users. You'd be on your own to choose how you'd make the key available to everyone else.

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.