3

Title was "Running yum update && yum upgrade without root-privileges?"

I want to allow an unprivileged user to start a system update on a RHEL-based system (CentOS 7). yum-cron is not an alternative, because the user should be flexible e.g. he should be able to decide when to shutdown the machine.

Any idea?

Jodka Lemon
  • 3,173

2 Answers2

5

You can simply setup your sudoers file and allow a user or a group to execute this one specific command. Syntax would look somehow like this in file /etc/sudoers (edit with visudo!):

user    ALL=(root) NOPASSWD: /usr/bin/yum update root

If you omit the NOPASSWD part, the user will have to provide his password. The users will get to run this simply as sudo yum update.

For more information, you can consult manual pages for sudoers(5)

Jakuje
  • 21,357
  • Thanks, already thought about a sudo solution. Are you sure about the 'obsolete alias' aspect? In my understanding it sets the --obsoletes flag and is not obsolete in itself. – Jodka Lemon Nov 15 '15 at 14:51
  • yes, you are right. I read and wrote too fast. Sorry for confusion. – Jakuje Nov 15 '15 at 14:53
0

Simple answer is no, it is not possible without root priviledges.

Deeper answer is you could compromise your system by making a sudo user user without a password. Which I don't recommend.