SSH using other users key

380 views Asked by At

Is it possible to create a UNIQUE key that can be used by all users to ssh to a server? I need to avoid creating a new key for each user and copying it to the server.

More in deep, I would create a key pair in a specific <key_path>, then copy the public key on the server and then let all the users ssh to the server just like this:

ssh -i <key_path> server-user@the-server

I tried to create a keypair with a specific user (call it userA) with no passphrase:

ssh-keygen -t rsa -f <key_path>

But when I try to use the userA's key with a different user (call it userB), I'm asked to enter the passphrase, even if there's no passphrase, and if I just press enter on the passphrase, I'm asked to insert the server-user password:

ssh -i <key_path> server-user@the-server
Enter passphrase for key <key_name>:
server-user@the-server's password:

I know I could generate a key for userA and another key for userB, but in my case I need to use the same key for different users.

0

There are 0 answers