Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to create a user on my CentOS box which is only allowed to run a couple of commands:

  • lvcreate
  • lvremove
  • mount
  • kpartx
  • rdiff-backup

And access to all files in /dev/ and /mnt. How do I set this up? The commands need to ran as root, but if someone is able to get access to the machine (somehow)

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I've done this using:

Cmnd_Alias      COMMANDS = /usr/sbin/lvcreate, /usr/sbin/lvremove, /sbin/kpartx, /usr/sbin/lvdisplay, /usr/bin/rdiff-backup, /bin/mount, /bin/umount
backupvps       ALL=NOPASSWD: COMMANDS
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.