How to SSH using a specific key

Posted on: March 21st, 2023
By: Tadeo Martinez

Sometimes you may need more than one key, so to specify which key you are using for the SSH connection, you have to specify it when connecting with SSH

ssh -i name_of_key.pem user@IP

If you are connecting to an Ubuntu machine using AWS, the user will be “ubuntu” but in other case it may be “ec2-user

Another thing to note, is that may need to change the permissions of your key so it works.

chmod 400 name_of_key.pem

And that if you get a .cer instead of a .pem it should work just fine.

Have any questions or comments? Write them below!

Leave a Reply

Your email address will not be published. Required fields are marked *