Unix/Linux Go Back    



Problem using sudo with NOPASSWD

HP-UX




Kindly Note - This is a Single User Post by Forum Member aigini82 Regarding:
Problem using sudo with NOPASSWD.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 04-11-2016   -   Original Discussion by aigini82
aigini82's Unix or Linux Image
aigini82 aigini82 is offline
Registered User
 
Join Date: Apr 2016
Last Activity: 11 April 2016, 11:00 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Problem using sudo with NOPASSWD

I need to configure access for a user in an HP-UX to :

1) use certain commands and
2) login as another user as a sudo.

These have to be done WITHOUT the user needing to enter a password.

However, after I enter the lines using visudo, there is a prompt for a password when the user executes those 2 commands.

This is the line I added in visudo :



Code:
etigers   ALL = NOPASSWD: /usr/sbin/sudo su - userX, /path/to/command/to/execute

However, initially before this line was added, there were 2 other lines above it, without the NOPASSWD option. Could it be that these 2 lines were overriding this line?

Also, in the visudo file there was no !#/bin/bash at the top of the file.

Or is it that for users first time using sudo, there will be a prompt for password?

Is there a need to restart visudo service? If so, how? What command? I tried using service visudo restart but it says 'service' no such command.