Results 1 to 6 of 6

Thread: bash2

  1. #1

    bash2

    Hello all,
    This isn't a security question but I know some of you could help.

    I just loaded RH 7.3 which comes with bash2. I had never tried bash2 as I usually use zsh, but was curious so I created a new user with bash2 as default shell and tried it.

    Problem is: In bash2 if i do:

    echo $PATH
    it shows a different path than what is listed in my .bash_profile; markedly different, ergo I am exasperated when I have to do ./ for every program I run.

    I did not set the PATH variable with command: PATH=/whatever but had only been using the .bash_profile to modify that users path.

    I've compared my bash_profile in my bash2 user and my bash user and they are the same, --and it works for plain ole bash user.

    I have consulted the man pages many times as well as the bash page at gnu.org but have found nothing.

    I know this is minor but I can't get it to work and its irksome. I know I could just go back to using bash but I seem to be a masochist when it comes to things like this and I really want to know what's going on.

    Any ideas anyone?

  2. #2
    str34m3r
    Guest
    Your PATH variable is actually built in a variety of places. Some of the parts come from your .bash_profile file. Sometimes pieces are added in your .bashrc file. Some more parts are added by the /etc/bashrc file, the /etc/profile file and files in the /etc/profile.d directory. Your exact PATH is built by many different shell startup scripts along the way based on your user ID, your groups, etc. You can read each of the files I mentioned if you want more details on why and how your PATH is created.

  3. #3
    I've gotten a chance to look at all but the last of the files which I'll look at tonight. I appreciate your input bro.

    cachinga

  4. #4
    AO Curmudgeon rcgreen's Avatar
    Join Date
    Nov 2001
    Posts
    2,716
    I think the PATH belongs to the user, and not to
    the shell per se. Find what's different between
    the user account with BASH as the default
    and the user account with BASH2 as default
    and there will be the answer. Each account
    has a separate home directory with its own
    configuration files.

    If you are in your normal account and invoke
    a new shell by typing it at the command
    line, it should inherit the same environment
    as the parent shell, but if you su to another user
    (or to root), the path should change to that
    of the different user..
    I came in to the world with nothing. I still have most of it.

  5. #5
    Senior Member
    Join Date
    Oct 2001
    Posts
    638
    it shows a different path than what is listed in my .bash_profile; markedly different, ergo I am exasperated when I have to do ./ for every program I run.
    There's a good reason why the current directory (.) is not included in your path. *nix makes you specify the path so you know exactly what executable/script you are running. This is because, if someone leaves a file in a directory that's in your path and writes an evil program and gives it a name that duplicates a common command, this creates a security risk.
    OpenBSD - The proactively secure operating system.

  6. #6
    Good thinking rcgreen, but, even if I su or sudo from any of the accounts or start another shell you are correct it gives me the profile of the bash2 user I'm su'ing or sudoing to. I'm beginning to think its a problem with the group that the bash2 user is in. I'm not positive of this by any means, but I created another bash2 user and assigned it to the bin, and root groups and that seemed to have worked.

    I didn't specify a group with the original problem bash2 user so he was in his own group.
    Another variable is that for the second bash2 user (that works) I just added with the adduser command instead of using the GUI user manager.

    If I get it straightened soon I'll let you know.

    cachinga

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •