Home Man
Today's Posts

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

👤 Login to reply

Thread Tools Search this Thread
# 1  
Old 04-11-2016
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 :

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.
# 2  
Old 04-11-2016
Wonder if ther is not something queer here...
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...
# 3  
Old 04-11-2016
Swapping places with each other still does not resolve this issue. This is the exact look of the user privilege in the visudo file.

## User privilege specification
#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 04-12-2016
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...
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
ssh foo.com sudo command - Prompts for sudo password as visible text. Help? fluoborate Shell Programming and Scripting 9 11-02-2011 02:18 PM
sudo wildcards problem: for every argument a *-wildcard? Better solution? slashdotweenie UNIX for Advanced & Expert Users 2 09-20-2011 10:12 AM
Problem with Sudo inside a here document mnanavati UNIX for Dummies Questions & Answers 0 11-12-2010 03:23 PM
Problem with password expire and sudo. sparcman Solaris 2 04-14-2010 01:18 PM
Sudo Problem? datkan Linux 1 04-08-2010 07:58 AM
shell script problem , sudo mount command cola Shell Programming and Scripting 3 08-19-2009 02:09 PM
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 08:01 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password