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
1 Answer
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.
- 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.sfanjoy– sfanjoy2022-05-19 12:55:01 +00:00Commented May 19, 2022 at 12:55
dnfhad "replaced"yumon RHEL 8. Yes, both are there under/usr/bin(AFAIR as symbolic links todnf-3) butdnfis now the "official' tool.