Setting Up SUDO

Problem

You want to allow a user to run one command, as root user.



Solution

To allow a user access to run stuff as root, just login as root and then add the following line to /etc/sudoers.


userid hostname=command



Example


For example to allow user marcus access on bree, to restart, stop, start or check apache:


marcus bree=/etc/init.d/httpd

To allow all access on all boxes:


marcus (ALL)=(ALL)



Reference

[tags]sudo, switch user do, temporary UNIX authorisation, Unix Coding School[/tags]



Previous Post

Leave a Reply

Your email address will not be published. Required fields are marked *