- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: SHLIB_PATH and su
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
тАО04-23-2009 05:09 AM
тАО04-23-2009 05:09 AM
I have a problem with my environnement variable : SHLIB_PATH.
I have initialize it in /etc/profile :
SHLIB_PATH=/usr/lib ....
export SHLIB_PATH
When i'm connect with one user it's ok :
echo $SHLIB_PATH
SHLIB_PATH=/usr/lib
But, if i use "su" like this way :
su toto
(witout the "-")
My environnement variable SHLIB_PATH disappear... And only SHLIB_PATH. I had try with an other and it's ok ...
I don't understand.
Can you help me, please ?
(Sorry for my english, i'm french ...)
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2009 05:19 AM
тАО04-23-2009 05:19 AM
Re: SHLIB_PATH and su
If you use the minus sign ("-"), "the new shell starts up as if the new user had initiated a new login session" and the environment is set accordingly. Without the minus sign, this does not happen - you just start a new shell without setting any special environment.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2009 05:21 AM
тАО04-23-2009 05:21 AM
Re: SHLIB_PATH and su
su without the - just changes the user and gives you the new users power. It does not load the environment of the new user and does not null value in SHLIB_PATH.
su - username
Loads the new users environment which clearly does not have settings for SHLIB_PATH
As Pete points out its all in the man page which states it better than I can.
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
тАО04-23-2009 05:21 AM
тАО04-23-2009 05:21 AM
Re: SHLIB_PATH and su
Your English is fine!
You need to specify 'SU_KEEP_ENV_VARS=SHLIB_PATH' in '/etc/security/default'. If you do not have the file, simply create it. See the manpages for details:
http://docs.hp.com/en/B3921-60631/security.4.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2009 05:25 AM
тАО04-23-2009 05:25 AM
Solutioni) Just set SHLIB_PATH again after you su, or:
ii) Make a global change to the system to not behave like this. To do this edit or create the file /etc/default/security and add the line:
SU_KEEP_ENV_VARS=SHLIB_PATH
But be aware this is changed for the whole system, so if you have security standards and/or a security team you might want to consider if its the right thing to do.
You can read more about this in the man page security(4) :
man 4 security
HTH
Duncan
I am an HPE Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2009 05:30 AM
тАО04-23-2009 05:30 AM
Re: SHLIB_PATH and su
It works with the file /etc/default/security (and not /etc/security/default, but it's written in the man page that you give)
Thanks for your help !
:-)