Operating System - HP-UX
1833871 Members
1710 Online
110063 Solutions
New Discussion

Re: Help with setting up sudo

 
Jim Bonia
Occasional Advisor

Help with setting up sudo

I am trying to get sudo to work on a couple different HP-UX 11.00 boxes. I downloaded and ran the sudo-1.6.2*.depot.gz and gunzipped it.
Then installed it using swinstall. What else do I have to do to get it to work? Do I have to add to the PATH?
I have a sudoers file in usr/local/etc. and as a side question: any users listed in the sudoers file have to be added as local users on the server, right?
Thanks kindly
Jim

3 REPLIES 3
Patrick Wallek
Honored Contributor

Re: Help with setting up sudo

To answer your questions:

1) Yes I would add sudo to the PATH. It doesn't do you any good if you can't get to it easily. :)

2) The users you define in sudo should already be defined locally on your machine. Again, sudo won't work very well if the user isn't logged in. If they can't already log in to the box, why are you setting them up in your sudoers file?
Jim Bonia
Occasional Advisor

Re: Help with setting up sudo

Thanks, I will add it to PATH.

Excuse the dumb question about users/sudoers.
I am learning ;-)

Thanks again.
federico_3
Honored Contributor

Re: Help with setting up sudo


after you have downloaded and installed the sudo software, you should add the sudo man pages:
#MANPATH=$MANPATH:/opt/sudo/man
#man sudo
#man visudo
#man sudoers
Now you must define which users can use, execute which commands with root permissions via the /etc/sudoers configuration file.>This file can be created and modified using visudo cpommand.
It could be like this:
#visudo
user1 ALL=/usr/sbin/lpshut,/usr/sbin/lpsched
dba ALL=/sbin/shutdown,/sbin/reboot

This file allows user1 to stop and start lp scheduler on any host with sudo installed and dba to shut and reboot.

To run commands:
login; user1
Passord: ******

$sudo /usr/sbin/lpshut


federico