changing su configuration - Linux

This is a discussion on changing su configuration - Linux ; 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 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: changing su configuration

  1. 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

  2. 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/

  3. 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



  4. 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


  5. 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 to Thread