rootsh on Solaris 10 is not sourcing root's .profile


 
Thread Tools Search this Thread
Operating Systems Solaris rootsh on Solaris 10 is not sourcing root's .profile
# 1  
Old 11-25-2009
rootsh on Solaris 10 is not sourcing root's .profile

I'm attempting to setup rootsh on Solaris 10 to log the activity of users who require root access. However it does not appear to be sourcing root's .profile file even when run with the '-i' option. I was wondering if anybody else has run into this and might have a solution.

Thank you.
# 2  
Old 11-26-2009
are these user's logging directly into root, or su'ing into root?

and are they using

"su"
or
"su -"
# 3  
Old 11-26-2009
It seems rootsh is sourcing the user's .profile, not root's one. I would say it's a rootsh bug as the HOME variable is being kept unmodified.
# 4  
Old 11-26-2009
I'm using rootsh via sudo, for example:

$ sudo rootsh -i

However it does not seem to source root's .profile or .bash_profile, so my prompt remains unchanged and I don't inherent root's PATH even though if I run an 'id' or 'who am i' I am effectively root.

I have yet to try on Solaris 9 to see if it has the same behavior as the INSTALL file mentions only Solaris 9 as having been tested.
# 5  
Old 11-26-2009
As I already wrote, rootsh is sourcing your profile, not root's one. You might detect who is sourcing your profile and set the PATH, HOME and whatever accordingly as a workaround.
# 6  
Old 11-26-2009
Thanks, you are right, it is still sourcing my profile. If I manually set my $HOME variable to / then it sources root's profile.

What I've done is setup an if-then statement that checks the $LOGNAME of the user. If it's root then it runs root's profile. This appears to be working well as a workaround.

Thanks for the insight! Smilie
# 7  
Old 11-26-2009
root access is only for system administrator and nobody else and that is final
set ALC entires and permissions instead giving root access
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Dot sourcing differences in ksh, AIX vs Linux vs Solaris

Why does dot sourcing of ksh functions behave so differently between AIX, Solaris, and Linux? How can I make Linux behave the way I want in the test I show below? I have a library of interdependent functions I have developed and use in ksh in AIX. They also run in Solaris. Now I am migrating... (9 Replies)
Discussion started by: charles_n_may
9 Replies

2. Shell Programming and Scripting

Sourcing as root automatically

Hey everyone! I have my .bash_profile file which is read automatically when I launch Terminal therefore I can run my own functions. BUT. When I do: sudo -s sudo su sudo su - No matter what I do, I can't get the .bash_profile file to be sourced automatically so I end up having to run... (2 Replies)
Discussion started by: dasx
2 Replies

3. UNIX for Dummies Questions & Answers

switch user (su) not sourcing the profile

Usually in solaris/Linux servers , when you do an su - username (space before and after the hyphen) the user's .profile should get sourced. But in the below linux machine it is not. As you see below ORACLE_HOME variable is not being set. # uname -a Linux revaltb214 2.6.18-238.el5 #1 SMP Sun... (7 Replies)
Discussion started by: John K
7 Replies

4. Shell Programming and Scripting

sourcing .profile for other users

Hi Team, Thank you for your time. i have a situation where the user IDs of the applicatio users have been locked down to Read only. Hence I am writing a script to invoke their old .profile every time they login. My problem is : when i run . $userpath/.profile from within the ksh script... (9 Replies)
Discussion started by: anitha111
9 Replies

5. AIX

aix 6.1 root .profile not found

hello all i just installed my 1rst 6.1 machine and it's working fine but i can't find the root .profile ????? can any one help BEst Regards (1 Reply)
Discussion started by: islam.said
1 Replies

6. AIX

Ho to copy root profile?

Does anybody know how to copy/mirror root profile in AIX 5.2? (1 Reply)
Discussion started by: fraydey
1 Replies

7. Solaris

trying to add .profile for root

I am trying to add a .profile for root I cd to / do vi .profile and get /var/tmp/ExGXaaqa Read only file system... What does this mean? (4 Replies)
Discussion started by: liven
4 Replies

8. UNIX for Dummies Questions & Answers

How to change root's .profile settings

As a regular (non-root) user on Unix servers I'm accustomed to changing my .profile file to set paths that I frequently use, etc. I am trying to learn unix and set up a test server running SunOS 5.8. When I login as root I don't see a .profile file that belongs to root wherein I could change the... (1 Reply)
Discussion started by: FredSmith
1 Replies

9. Solaris

.profile for root ?

Hi friends, On a Solaris system is the .profile executed for the user root also as it is for any normal user ? if i have to change the PATH variable can i add it to the .profile? and by default ther .profile is not found in the / directory. i can see it in /etc as /etc/profile. Should i... (1 Reply)
Discussion started by: sveera
1 Replies

10. UNIX for Dummies Questions & Answers

SunOS - root's .profile

There is no .profile file for the root user. It should reside in "/". Can I just copy a .profile file into "/"? (3 Replies)
Discussion started by: xadamz23
3 Replies
Login or Register to Ask a Question