I just can't seem to get it to work in Ubuntu, it should be a simple answer, maybe someone can help me. All I am trying to do is get a sudoers to use their own history file, but if I set the history var in the .bashrc
for root with:
HISTFILE="/root/.bash_history.$SUDO_USER"
nothing seems to happen.
I have tried changing the /root/.bashrc
and /etc/skel/.bashrc
with the above entry. Nothing. I have gotten this to work in CentOS before (See make sudoers use their own history file).
I even moved the entry to the start of the file, as I found some suggestions that stated it may be ignored after a certain point, but regardless of the position, the history files are not being created. If I use my arrow key however the history entries are there... where they come from I have no clue anymore, it seems like some kind of magic, Voodoo it seems.
Any help would be appreciated.
sudo -i
? What doesecho $HISTFILE
give when you're in a sudo session?dash
should not come into play here - it is only used as replacement forbash
when invoked as/bin/sh
. Interactive shells are not influenced.