Here's my issue
I have an ec-2 instance on AWS running Ubuntu Server. During the initial launch of the instance, I generated the key-pair by going to AWS console --> Key Pairs --> Create key pair. It generated a key abcxxxx.pem and I have saved it.
Here's where the issue starts
I head a project where multiple developers come on and off. Without too much thought, I distributed my .pem file to 2-3 developers. They have left the project since and I want to restrict AWS access to only active developers. Basically I don't want the 2-3 developers (with .pem file) to access my machine.
For all the new developers ( I no longer distribute .pem file), I give access to AWS machine by pasting there
public key
in/home/ubuntu/.ssh/authorized_keys
. This gives them access to the machine.
My two questions are as follows
- How can I restrict access to people who already have .pem file?
Will deleting their public key from
/home/ubuntu/.ssh/authorized_keys
make a difference? NOTE: I still have the key and only I have the access to AWS console. - How are the new developers able to access the AWS machine without a .pem file? (The only thing I do is paste their public key in the authorized_keys on AWS)
- How do I implement a system where I have sole access and I deal with developers coming on/off on the project?
- All users(including me) who's public key is in the authorized_keys on AWS machine can login without a .pem file. How is this possible? Doesn't everyone need a .pem file to ssh in?
I'm really confused about this key-pair business (what's the role of .pem file?) and other posts online don't seem to help (even AWS support). Most posts online address scenarios where you lose the key and you have launch a new instance etc. etc. I contacted AWS support and they just sent me this link. I don't understand how this helps.
Any solution/elaborate answer will be really helpful.