0

As a system administrator I want to give permission for user let's say "teacher" to run commands as root without knowing password of root, what to do?

0

You can add a Cmnd alias into sudoers file, edit it with visudo to prevent accidentally getting yourself locked out of the file. Then make a global alias for the command in the global bashrc.

Add to visudo:

Cmnd_Alias ADDUSER_PASS = /usr/sbin/adduser
user_name ALL=(ALL) ADDUSER_PASS

Add to /etc/bash.bashrc:

alias adduser="sudo /usr/sbin/adduser"

Replace the user_name with the user you want to have access and the command directory for whatever command you want them to use.

| improve this answer | |

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