- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Sudo Password Problems
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:00 AM
09-19-2007 12:00 AM
Sudo Password Problems
I'm configuring the sudo file user specification. When issuing the command, it's still prompting for a password. The username is an alias and the command string is an alias.
USERNAMEGROUP ALL=(user2) NOPASSWD: COMMANDVAR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:36 AM
09-19-2007 12:36 AM
Re: Sudo Password Problems
Sudo is very, very picky about the commands it allows. If your COMMANDVAR is specified like this:
Cmnd_Alias COMMANDVAR = ls
it won't work.
You must specify something like
Cmnd_Alias COMMANDVAR = /bin/ls
instead.
This behaviour is by design: it ensures the user cannot use commands the sysadmin did not intend by playing tricks with his/her PATH environment variable.
And what's the exact sudo command line you're trying? It should be something like
sudo -u user2
If the "-u user2" option is not specified, sudo will assume "-u root" by default... which of course does not match your rule.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:37 AM
09-19-2007 12:37 AM
Re: Sudo Password Problems
Form:
sudo program-name
Any other form will prompt for a password.
Check that you are not using reserved words in your sudoers configuration.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:48 AM
09-19-2007 12:48 AM
Re: Sudo Password Problems
the command line string
sudo -u user2 command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:59 AM
09-19-2007 12:59 AM
Re: Sudo Password Problems
where USERNAMEGROUP is a User_Alias in the syntax:
User_Alias USERNAMEGROUP=USER
where USER above is also in caps (as in /etc/passwd)
where (user2) is a Runas_Alias in the form USER2=user2 and is in caps in the user specification.
where COMMANDVAR is a Cmnd_Alias in the form
Cmnd_Alias COMMANDVAR=/path/executable,/path/executable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:59 AM
09-19-2007 12:59 AM
Re: Sudo Password Problems
Does the output look correct?
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 01:02 AM
09-19-2007 01:02 AM
Re: Sudo Password Problems
(user2) NOPASSWD: /path/executable, /path/executable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 01:04 AM
09-19-2007 01:04 AM
Re: Sudo Password Problems
sudo program-name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 08:31 PM
09-19-2007 08:31 PM
Re: Sudo Password Problems
/usr/local/bin/sudo -u 'username' 'command_exactly_as_referencec_in_sudoers'