When I created my
EC2 instance, I was given a
.pem private key file. I did it as the
root user for my account. Then I created an IAM user and associated that user with a full EC2 access. When I logged in as that user, I was able to see the instance I created as root but when I went to see the connection instructions, they were the same as for the root, specifying the same private key file as the root. My instance type is
Ubuntu so the default user on the instance is ubuntu.
My question is, how can I enforce that when a user connects to an instance, he is associated with his own host (instance) user? So if the AWS root logs into the instance as ubuntu, I would like the AWS user awsuser1 to be logged into the instance as ubuntu1.