/var/root is definitely root's home directory, but I can find no history file there. BTW,
sudo -H bash will not change to the home directory, you need to also
cd after it.
I assumed that the OP knew that his problem (passwords) were in root's history.
Unless you have a habit of running sudo with -H or if you have root logins enabled, root shares your settings (since sudo without -H keeps the original user's HOME) and runs .bashrc from the original user's HOME, saves history in there etc.
Quick test with:
host user $ sudo bash
Password:
host user # echo hello_world
hello_world
host user # exit
host user $ grep hello_world .bash_history
echo hello_world
host user $
That makes a lot of sense. It was what I suspected at first, and yet root's history didn't seem to match with my own. Then I remembered my default shell at login is tcsh and that was what root was using! Duh!
This thread has been closed by the system or the community team.
You may vote for any posts you find helpful, or search the Community for additional answers.
bash history for root user...
Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.