- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Sudo giving problem
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
11-30-2009 11:39 PM
11-30-2009 11:39 PM
Sudo version: 1.6.9p5.001
I have an application super user name “ops”, which has some environment variables. And all application binary is executable and owned by “ops” user. I want to create some individual user ID’s who are able to run “ops” binaries using his own environment variables.
But unfortunately, when I run “env“ command of the individual user’s its showing the variables as like as of the super user “ops”. But when I run command “env” using sudo, i.e. sudo –u ops env, it shows only the default variables.
But in my other servers (OS: 11iv1) it showing correctly.
Where would be the problem?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2009 12:27 AM
12-01-2009 12:27 AM
SolutionOlder versions of sudo are less strict in this. If you want to know exactly when the change did happen, read the release history document of sudo.
With the new versions, you must explicitly list in the sudoers file the environment variables that your users are allowed to pass to the ops user. See "man sudoers" for more details.
The necessary sudoers configuration line would probably be something like this:
Defaults > ops env_keep+="VARIABLE_NAME1 VARIABLE_NAME2"
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2009 11:18 PM
12-01-2009 11:18 PM
Re: Sudo giving problem
Apart from this, I have a file contains huge number of Environment variables. It's troublesome job to put all environment variables as you said.
How can I configure sudoers with the specific environment variables files?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2009 11:38 PM
12-01-2009 11:38 PM
Re: Sudo giving problem
I thought there was an option to allow all variables to pass through?
We had one application stop working on the new sudo. We either had to use that option or better, pass that one variable on the command line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2009 11:44 PM
12-01-2009 11:44 PM
Re: Sudo giving problem
Can you clear that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2009 01:09 AM
12-02-2009 01:09 AM
Re: Sudo giving problem
See -E in the manual:
http://www.sudo.ws/sudo/man/sudo.html#options
It mentions:
It is only available when either the matching command has the SETENV tag or the setenv option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2010 08:28 PM
01-17-2010 08:28 PM
Re: Sudo giving problem
But user is habituated with only sudo -u
How can I use the above syntax without using -E?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2010 08:43 PM
01-17-2010 08:43 PM
Re: Sudo giving problem
Create an alias for sudo something like
alias sudo="sudo -E"
You need to put the above command in the proposed user's .profile to have it permanent over logins
Regards
Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2010 12:56 AM
01-18-2010 12:56 AM