/etc/bash.bashrc doesn't work for bash version 4.3.30

Asked by herbert

I defined some alias in /etc/bash.bashrc When I login using "herbert", I can use these alias But after I "su root", these alias cann't be used anymore.

This is very strange because configs in /etc/bash.bashrc should be global and can be used be all users. Everything worked fine before but went strange these days. What I can remember is that I upgraded my bash, from 4.2.25 to 4.3.30, but I am not sure whether version is the reason.

After test, this works fine with other bash versions such as 4.2.25. Could you please investigate into this problem?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

What is the output of the terminal commands

uname -a
lsb_release -a
apt-cache policy bash
bash --version

The security concept of Ubuntu advises against usage of the su command. You better use sudo (or e.g. sudo -i -u <username>), see also https://help.ubuntu.com/community/RootSudo

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#2

su root

Makes you become root, so you will get root's bash configuration. If you use 'sudo -s' you will keep your user's configuration.

Revision history for this message
herbert (hubing1208) said :
#3

Thanks actionparsnip, that solved my question.