In order to make the behavior system wide, I put unset HISTFILE
in /etc/profile
. Normal users no longer have .bash_history
but root still does. Anyone can tell me what I am doing wrong here? Or what is another proper place I should use instead of /etc/profile
? There is /root/.bashrc
which probably do the trick for root, but I just want this setting in one global place so I can toggle it easily, pogo?
Add a comment
|
1 Answer
You must take in count the order, how these files apply when user/root logs in. The profile is read first, the ~/.bashrc the last so if you set/unset some variable in the profile, it can be overwritten in the ~/.bashrc of each user. So what you made is like template of the environment, which can be overwritten.
And there are more files you'd better have a look at:
- content of /etc/profile.d
- /etc/bash.bashrc
It's better described in this post: