0

I need to specify the prefix of the rpms that a specific user can install on a CentOS 7 server. For example, let's say that I have:

  • my_package_foo.rpm
  • my_package_boo.rpm

I thought that I could add this:

my_user ALL=NOPASSWD: /bin/rpm* my_package*

But it's not working.

I also tried variations, like:

my_user ALL=NOPASSWD: /bin/rpm my_package*

Finally I tried like below, but this allows me to install any rpm, what I don't want.

my_user ALL=NOPASSWD: /bin/rpm
Arthur Accioly
  • 801
  • 9
  • 26

1 Answers1

0

I could figure out the problem.

I was trying to install my package using -ivh, but this was not correct in my sudoers file. So I adjusted like this and worked:

my_user ALL=NOPASSWD: /bin/rpm -* my_package*

Now I can install using:

sudo rpm -ivh my_package_boo.rpm
sudo rpm -e my_package_boo
(...)
Arthur Accioly
  • 801
  • 9
  • 26