1753767 Members
5929 Online
108799 Solutions
New Discussion юеВ

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

3 REPLIES 3
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
WEBADMIN ALL = NOPASSWD: APACHE

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 http://software.hp.com 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.

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
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.

Example

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