Sudo doesn't work

I edited sudoers like this:

vi /etc/sudoers
subex ALL =(root) NOPASSWD: /usr/ccs/bin/pstack

But the respective user still is prompted for password, and even when the right password is used, the command is still not launched.

[subex@host]$sudo usr/ccs/bin/pstack 26557

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:
subex is not in the sudoers file.  This incident will be reported.
uname -a
HP-UX host B.11.31 U ia64 0970517552 unlimited-user license

You might want to try:

subex ALL = ( /usr/ccs/bin/pstack) NOPASSWD: ALL

Then start by

sudo /usr/ccs/bin/pstack

hth

subex must be one of:

  1. a User_Alias -- you define subex in /etc/sudoers
  2. a username in etc/passwd

Note: use visudo to modify /etc/sudoers

There also is such a thing as a Group_Alias - see the wheel example in the sudoers file that came in the package

It only worked for me when I edited /usr/local/etc/sudoers

I wanted to use visudo (this way the proper sudoers file would;ve been indicated to me), but I didn't have visudo.

you must have visudo installed but it will not be in standard PATH so you have to look for it and add to your PATH variable...

Usually there is .../sbin/visudo next to .../bin/sudo
Also your sudoers file might be in

.../etc/sudoers

or even somewhere else!