Reputation: 110970
I have a linux box on amazon's aws EC2. I can view the user's bash_history here:
/home/ec2-user/.bash_history
However when I root in:
sudo -s
I do not get the root's bash_history. How can I view/find the bash_history for the admin user?
Thanks, Brett
Upvotes: 7
Views: 36223
Reputation: 208
Enable the logging within sudo, by inserting this with visudo
Defaults logfile=/var/log/sudo.log
Upvotes: 1
Reputation: 1118
You can run the history command to see the current users history.
Upvotes: 6
Reputation: 2909
When you "sudo -s", you apparently get the .bash_history of the source account, because $HOME is unchanged.
Try setting $HOME to ~root before you sudo -s.
Upvotes: 1