In our organization, we manage a considerable number of EC2 instances. In past we've been distributing SSH keys to users for login access, but this approach poses security risks if the keys are compromised.
I'm exploring alternative solutions to securely manage user access. My initial thought is to leverage IAM to restrict user access on a per-EC2 basis and revoke access by removing roles. However, if IAM isn't suitable for this purpose, I'm also considering utilizing Amazon's managed AWS Directory Service.
Could someone advise on how to implement user access control using IAM or AWS Directory Service? Additionally, I'm open to suggestions for other services that offer granular access control, including the ability to revoke access policies and restrict logins on a per-EC2 level.