Announcement

Collapse
No announcement yet.

bash login shell vs bash interactive shell

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    bash login shell vs bash interactive shell

    In debian systems (and in man bash), the login shell (got with su -) does not read /etc/bash.bashrc. Only the interactive shell does.
    In Kubuntu, I enter "su -" to access root, and lo... the /etc/bash.bashrc gets read by the resulting login shell, and so I had placed all my bash initialiation customizations (i.e. PS1 and aliases) into /etc/bash.bashrc, so that all users including root will give me the same experience. Kubuntu does many funny things such as giving root privs to ordinary user passwords, hmmmm....
    My question is: What has Kubuntu done that causes login shells to read /etc/bash.bashrc?

    #2
    Re: bash login shell vs bash interactive shell

    user$> cat /etc/profile
    # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
    # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

    if [ -d /etc/profile.d ]; then
    for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
    . $i
    fi
    done
    unset i
    fi

    if [ "$PS1" ]; then
    if [ "$BASH" ]; then
    PS1='\u@\h:\w\$ '

    if [ -f /etc/bash.bashrc ]; then
    . /etc/bash.bashrc
    fi

    else
    if [ "`id -u`" -eq 0 ]; then
    PS1='# '
    else
    PS1='$ '
    fi
    fi
    fi

    umask 022
    maybe?

    Originally posted by wwindtalker
    In Kubuntu, I enter "su -" to access root...
    ubuntu systems are set up for use with sudo.
    so, in principles, the root account is locked and you should use sudo -i.
    i also usually unlock the root account, though.

    Originally posted by wwindtalker
    ...Kubuntu does many funny things such as giving root privs to ordinary user passwords, hmmmm....
    that is given by default (via sudo) to the user created at installation time.
    i don't recall if this is also default for users added via system settings and stuff.
    i should have thought it is not.
    anyway...easily controlled.
    remove the users in question from group admin.
    or change the default settings in /etc/sudoers to give sudo access to your account only.

    hth
    gnu/linux is not windoze

    Comment


      #3
      Re: bash login shell vs bash interactive shell

      maybe... yes!
      Thank you, that was the answer to my question. I went to my Debian machine and fixed it to work like the Kubuntu (in that respect).

      I forgot to mention... Earlier I had actually made a root user in Kubuntu, and with its own password, which I use when I su -.
      I know I didn't have to do that (and the Kubuntu wisdom says "don't!"), but I want to feel good in my familiar environment.

      Comment


        #4
        Re: bash login shell vs bash interactive shell

        Originally posted by wwindtalker
        ...but I want to feel good in my familiar environment.
        i understand very well.
        i do the same.
        gnu/linux is not windoze

        Comment

        Working...
        X