changing su configuration

This is a discussion on changing su configuration within the Linux Administration forums, part of the Linux Forums category; Is there anyway to make "su -" stop changing into roots directory. Whenever I am working on a file ...


Go Back   Usenet Forums > Linux Forums > Linux Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-12-2004
Tommy M
 
Posts: n/a
Default changing su configuration

Is there anyway to make "su -" stop changing into roots directory.
Whenever I am working on a file that requires root permissions and or
things in roots path I su -. But I always have to cd back to the
directory I want to work in. It is really annoying me.
How do I stop su from changing to roots directory?
Thanks
Reply With Quote
  #2 (permalink)  
Old 10-12-2004
Bjørn Tore Sund
 
Posts: n/a
Default Re: changing su configuration

On Tue, 12 Oct 2004 10:50:28 -0400, Tommy M wrote:
> Is there anyway to make "su -" stop changing into roots directory.
> Whenever I am working on a file that requires root permissions and or
> things in roots path I su -. But I always have to cd back to the
> directory I want to work in. It is really annoying me.
> How do I stop su from changing to roots directory?


By not adding a '-' to the 'su' command.

Bjørn
--
Bjørn Tore Sund "When in fear, and when in doubt;
bjornts@ii.uib.no Run in circles, scream and shout!"
Interaction! - Anonymous
http://www.interaction.worldcon.org.uk/
Reply With Quote
  #3 (permalink)  
Old 10-12-2004
Tommy M
 
Posts: n/a
Default Re: changing su configuration

But the $PATH is not the same. I only want to stop the cd


[tom@lugh tom]$ su
Password:
[root@lugh tom]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/tom/bin

[tom@lugh tom]$ su -
Password:
[root@lugh root]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin


On Tue, 12 Oct 2004 15:10:14 +0000, Bjørn Tore Sund wrote:
>
> By not adding a '-' to the 'su' command.
>
> Bjørn


Reply With Quote
  #4 (permalink)  
Old 10-12-2004
jab3
 
Posts: n/a
Default Re: changing su configuration

Tommy M finally wrote on Tue October 12 2004 10:50 am:

> Is there anyway to make "su -" stop changing into roots directory.
> Whenever I am working on a file that requires root permissions and or
> things in roots path I su -. But I always have to cd back to the
> directory I want to work in. It is really annoying me.
> How do I stop su from changing to roots directory?
> Thanks


Well, I suppose there are a few solutions. The first I came up with was a
quick and dirty script:

su- (or whatever you want the command to be,ssu,suu,qsu, etc. :})
#!/bin/sh

CURD=`pwd`
su -
cd $CURD

--------------

Also, after doing 'man su' - I found something you may want to check out:
the ENV_SUPATH option in login.defs. That may be easier.


-jab3

Reply With Quote
  #5 (permalink)  
Old 10-12-2004
jab3
 
Posts: n/a
Default Re: changing su configuration

jab3 finally wrote on Tue October 12 2004 01:58 pm:

> Well, I suppose there are a few solutions. The first I came up with was a
> quick and dirty script:
>
> su- (or whatever you want the command to be,ssu,suu,qsu, etc. :})
> #!/bin/sh
>
> CURD=`pwd`
> su -
> cd $CURD
>


You can safely ignore that, as you have probably already figured out. I
wasn't thinking about what I was doing. Once 'su -' happens, there is no
current script :). I'm an idiot.


-jab3
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:46 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0