Nov 10, 2018

How to setup shared key login for Linux server

A shared login is an extremely bad idea. But you may like it for a test environment. Let's do it here, basically it shares private key for login, at least not worse than to share the password.

Generate the key pair:

$ ssh-keygen -b 2048 -f i88caKey -t rsa

Put your public key into authorized_keys file:

$ cat i88caKey.pub >> ~/.ssh/authorized_keys

Permission of authorized_keys needs to be 600

Now share the private key i88caKey to those who need it.

You can rename the file to for example i88caKey.pem

Now you can login with this private key:

$ ssh -i i88caKey.pem test@i88.ca