View Single Post
casper27's Avatar
Posts: 844 | Thanked: 521 times | Joined on Jan 2009 @ UK southampton
#6
Originally Posted by rewt View Post
It's possible that your .ash_history has the incorrect permissions/ownership. This will probably only occur if the first time you open xterm you sudo gainroot - since no .ash_history exists, when you exit root's shell it is created owner=root, group=root preventing non-root command history from being written to the file.

Use 'ls -l /home/user/.ash_history' to verify. If the file is owned by root (3rd column), that is your problem.

sudo gainroot
chown user.users /home/user/.ash_history

OR

sudo gainroot
chmod a+w /home/user/.ash_history

Either will fix the permissions to allow non-root command history to be retained.
Sweet worked great cheers.