Unix/Linux Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Problem using sudo with NOPASSWD

HP-UX


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 04-11-2016
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.
Sponsored Links
    #2  
Old Unix and Linux 04-11-2016
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 27 March 2017, 4:39 PM EDT
Location: Switzerland - GE
Posts: 6,398
Thanks: 266
Thanked 537 Times in 499 Posts
Wonder if ther is not something queer here...
try:

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

Check the path to su as I have no more HP-UX under my hand to verify... You need to give absolute path to binaries in sudoers for sudo to work properly...
Sponsored Links
    #3  
Old Unix and Linux 04-11-2016
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
Swapping places with each other still does not resolve this issue. This is the exact look of the user privilege in the visudo file.


Code:
## User privilege specification
##
#etigers ALL=NOPASSWD:ALL
#emokchee ALL=NOPASSWD: /usr/local/bin/lsof
etigers ALL=(ALL) NOPASSWD:/bscsbin/bscst4/lisa/product/UMOBILE/prod/bscs/bin/hpux11_ia64.x/dmh, /usr/local/bin/sudo su - bscst4
root ALL=(ALL) ALL
#%bscs ALL=(ALL) ALL
#emokchee ALL=NOPASSWD: /usr/local/bin/lsof
#etigers ALL=(ALL) NOPASSWD: /usr/local/bin/sudo su - bscst4, /bscsbin/bscst4/lisa/product/UMOBILE/prod/bscs/bin/hpux11_ia64.x/dmh

    #4  
Old Unix and Linux 04-12-2016
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 27 March 2017, 4:39 PM EDT
Location: Switzerland - GE
Posts: 6,398
Thanks: 266
Thanked 537 Times in 499 Posts
You didnt copy exactly the line... And you did not give absolute path to su...

I removed /usr/local/sudo...
And the reason of inverting is I dont know what version of HP-UX you are on nor do we know which sudo, sudo behaviour cant change drastically depending on how good you know the product and compile with your custom options...
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
LDAP - sudoers and the nopasswd flag - How can i set some commands for wheelgroup without password? darktux UNIX and Linux Applications 0 03-19-2016 10:22 AM
Sudo Problem? datkan Linux 1 04-08-2010 07:58 AM
Switch user :NOPASSWD setting mindtee_abhi UNIX for Advanced & Expert Users 2 03-19-2009 12:03 AM
Sudo command problem mindtee_abhi UNIX for Advanced & Expert Users 4 03-17-2009 01:24 AM
problem with sudo su and .sh script cleansing_flame Shell Programming and Scripting 1 01-14-2008 02:32 PM



All times are GMT -4. The time now is 12:30 AM.