Unix Technical Forum

root's profile

This is a discussion on root's profile within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi, I want to source root's profile whenever any user switch to root...so in essence I want to impose ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 12:31 PM
sghani73@gmail.com
 
Posts: n/a
Default root's profile

Hi,

I want to source root's profile whenever any user switch to root...so
in essence I want to impose the behaviour of su - even if the user
only do su to root (with out the - )

How can this be done if possible...I played a bit around with alias
but then give up...

let me know


Thanks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 12:31 PM
Kevin Bowling
 
Posts: n/a
Default Re: root's profile

sghani73@gmail.com wrote:
> Hi,
>
> I want to source root's profile whenever any user switch to root...so
> in essence I want to impose the behaviour of su - even if the user
> only do su to root (with out the - )
>
> How can this be done if possible...I played a bit around with alias
> but then give up...
>
> let me know
>
>
> Thanks
>


A strange request but I have an idea. How about moving su to a new
location like /bin/su.real and in its place putting a shell script. The
script would need to parse any command line arguments you'd like to
pass and then call `su.real - {optional username/args/etc}`.

Kevin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 12:32 PM
Mark Taylor
 
Posts: n/a
Default Re: root's profile

> A strange request but I have an idea. How about moving su to a new
> location like /bin/su.real and in its place putting a shell script. The
> script would need to parse any command line arguments you'd like to
> pass and then call `su.real - {optional username/args/etc}`.
>
> Kevin


This is a good idea, but remember to document what you have done and
how to re-create it because when you upgrade and there are changes to
the "su" command, then your shell script will get overwritten.

Rgds
Mark Taylor


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 12:32 PM
caseyjbrotherton@gmail.com
 
Posts: n/a
Default Re: root's profile

The original poster didn't mention why they would want to force root's
profile to be sourced.

If it is for some beneficial environment variable setup (for instance
variables for proper application operation),
then I think it would be easier to set up a script that defined these
environment variables before
running the applications that required them.

If the reason is for some rudimentary security control, or tracking
root user access,
then your method is very inadequate.
I would suggest looking at sudo. (Ideally with syslog logging off of
the machine in question, and with only
priv's granted that are really needed, etc)

If you insist that there is another reason that you would want to
force root's profile being sourced,
and decide to move su, I would highly recommend looking at the command
epkg for tracking your
changes. This will lock the lpp that contains su, so that you don't
inadvertantly upgrade and suddenly
lose your scripts and configuration.
(For more information, consult your friendly manual page, or:
http://publib.boulder.ibm.com/infoce...cmds2/epkg.htm
)

Hope this helps,
Casey

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:10 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com