0

I give a user admin access with: usermod -a -G wheel userX but when I log in with userX, I am not able to run yum. What do I need to do? Thanks

4
  • Did you mean "sudo yum"? Commented Jun 20, 2020 at 15:13
  • You realise, if you want to grant a user the right to run yum, you might give him the right to full root instead? (Reason: if you can install arbitrary stuff and replace existing binaries with those of your choice, you can grant full root anyway). You might miss the sticky sudo bit Commented Jun 20, 2020 at 15:13
  • the user must have right to install packages with yum Commented Jun 20, 2020 at 15:15
  • Humm, I thought dnf had "replaced" yum on RHEL 8. Yes, both are there under /usr/bin (AFAIR as symbolic links to dnf-3) but dnf is now the "official' tool. Commented Jun 22, 2020 at 16:39

1 Answer 1

1

Is the wheel group commented out in /etc/sudoers? In the event that it is, the enrollment for userX in wheel will make no difference.

That being said, you don't have to enroll this user in wheel if you just want them to install packages via sudo yum. Just give that user the specific permission in /etc/sudoers:

userX ALL = NOPASSWD : /usr/bin/yum, /bin/rpm

userX would now be able to sudo yum install whatever, sudo rpm -i whatever (passwordless) but would be unable to run any other commands. You could remove them from the wheel group if you do this and have a more secure host. This depends on how much you trust this user and if you're comfortable enabling this functionality for them. Everything is a security risk, no matter which path you choose, so be sure you're wary of who you're adding.

1
  • I tried to create a devops user and added it to the sudoers file for installing packages but had no luck. I got this error: error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied). The idea is to have a controlled non root user with keys that can distribute and install software updates. Commented May 19, 2022 at 12:55

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.