Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

Your Answer


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.