sudo users

srinivasa rao vaddadi
Frequent Advisor

sudo users

how can i create a sudo user.
and what entries i've to give in the /etc/sudoers file




Moved from HP-UX>Workload/Resource Management to HP-UX > security

Hakan Aribas
Valued Contributor

Re: sudo users

Sudo relies on /etc/sudoers to determine user privilege levels. For example, if we wanted to give users 'smith' and 'jones' the authority to perform certain system tasks, /etc/sudoers might look like this:

User_Alias WEBADMIN = smith, jones
Cmnd_Alias APACHE = /usr/local/sbin/apachectl

Doug O'Leary
Honored Contributor

Re: sudo users

You'll also need to ensure you have the sudo pacakge installed on your system.

swlist | grep -i sudo

to see if you have it.

Download it from if you don't.

Once installed, use visudo to edit/update the sudoers file. visudo will be in either /opt/sudo/sbin/visudo or /usr/local/sbin/visudo depending on installation source.

visudo checks the syntax of the suders file to ensure its correct. There are a good number of notes in the sudoers file directly. The man pages that come w/sudo are particularly helpful for more detailed configurations.



Senior UNIX Admin
O'Leary Computers Inc
Mel Burslan
Honored Contributor

Re: sudo users

or in most simplified form, you can add a line like this to your /etc/sudoers file:

username hostname = NOPASSWORD /explicit/path/to/command

which enables this username on this hostname to run the command without knowing the root password.


mel alpine = NOPASSWORD /opt/perf/bin/glance

this line enable user mel on server named alpine to run glance without having root password.
UNIX because I majored in cryptology...