I just want to know how to restrict access to a specific folder in EC2. For example: after logging in as ec2-user, I went to root and created a new user "user1". Assigned the SSh keys to this user so that, "user1" can login to the system just as ec2-user.
Now, There is some folder I dont want "user1" to have access. Or I don’t want "user1" to start and stop a specific job like systemctl start httpd or systemctl stop httpd. Only with valid permission should be able to to this action.
How should I implement this security solution. Is it we have to go inside EC2 Linux instance and setup permissions or can we do that when we create an instance.
In my Organization, We added new user to login to EC2, and we dont want to give access to start or stop the application like above.
How do we achieve this.