- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- help with sudo and a user profile
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
Discussions
Discussions
Forums
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
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
тАО05-20-2003 10:24 AM
тАО05-20-2003 10:24 AM
help with sudo and a user profile
My problem is that I need the same environment that I get with su.
Example:
su - oracle
this setups a host of oracle environment variables for the dba. Using sudo -u oracle does not set up these variables. I have tries the -H, -s, env -i options with out success.
Can anyone help?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2003 10:36 AM
тАО05-20-2003 10:36 AM
Re: help with sudo and a user profile
Cmnd_Alias SUORACLE = /usr/bin/su oracle, /usr/bin/su - oracle
then assign that alias to whatever user you want.
The users assigned the alias will be able to login as oracle with the appropriate environment set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2003 10:51 AM
тАО05-20-2003 10:51 AM
Re: help with sudo and a user profile
. /home/oracle/setenv.sh
If you do this often, then you can source it from your .profile .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2003 10:52 AM
тАО05-20-2003 10:52 AM
Re: help with sudo and a user profile
User_Alias EXAMPLE = nobody, peter, frank
....
...
write:
EXAMPLE ALL = NOPASSWD: SUORACLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-21-2003 07:24 AM
тАО05-21-2003 07:24 AM
Re: help with sudo and a user profile
Thanks for the replies but none are answering my question. I do not need a command alias for "su". What I need is a way to run the .profile or get the environment setup by the .profile when a dba runs "sudo" to become oracle. The basic command is:
$ sudo -u oracle
I have tried sourcing the .profile with the following option
env -i ENV=/home/oracle/.profile
This did not work. I have an alias for for this I just can't get the environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-21-2003 11:01 PM
тАО05-21-2003 11:01 PM
Re: help with sudo and a user profile
sudo su - oracle
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2003 05:02 AM
тАО05-28-2003 05:02 AM
Re: help with sudo and a user profile
As an fyi here is the solution:
sudo -H -u oracle8 env -i ENV=/opt/oracle8/product/8.1.7/ora-prof ksh
Where ora-prof simply does a . /opt/oracle8/product/8.1.7/.profile
Thanks again,
Stephen