vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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 |
| |||
| > 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 |
| ||||
| 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 |