0

In Amazon linux on my ec2 server, how do I allow a group of restricted users to su to a specific user. Also I would like for them not to be prompted for password. I have a group called 'my-users' and a user called 'app-admin'. I would like for 'my-users' to be able to su into 'app-admin' and use that user to run programs. I don't want 'my-users' to have root access. Do I need to edit the sudoers file? Do I need to edit the /etc/sudoers.d/cloud-init file?

3
  • 1
    Tell the password of app-admin to your trusted users, then they can su to that user anytime. Commented Aug 15, 2018 at 19:15
  • I want to users being in the 'my-users' group to be the only requirement to su into the 'app-admin' user. I want to avoid the use of passwords in this case. Commented Aug 15, 2018 at 19:18
  • Then create a suid binary shell file, with owner: app-admin, and group: my-users, other: 000 Commented Aug 15, 2018 at 19:21

1 Answer 1

0

I figured out the answer. In your sudoers file, you can put the following entry:

%my-users ALL=NOPASSWD: /bin/su - app-admin

Then you can use the following to login:

sudo su - app-admin

Note: Be sure to use sudo visudo to edit anything sudo related or you could corrupt your sudo privileges.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.