So my ubuntu user's .bash_history just won't show up when I hit history
. So I check permissions and the .bash_history in /home/ubuntu is now owned by root. Any idea what might've happened? I checked the root user's history and didn't notice anything that would've caused this.
Also, when I use the mysql client, it appends a long string of " " to the end of some lines.
To solve BOTH issues, I chown'd the .bash_history back to ubuntu:ubuntu. Any idea why this happened?
There's no way to know for sure what happened unless you have command auditing on your system and are willing to sift through every command executed between "when it last worked" and "when it broke".
As a wild-ass guess: You somehow executed
bash
as root with$HOME
environment variable still set to this user's home directory. There are lots of ways to do this (e.g.su -m
will preserve$HOME
).You probably ran a command like
sudo su
to get a root shell. That will keep the same environment, meaning your home was used as root. If you want a root shell usesudo -i
.