[SOLVED] Clear all traces of "su password" mistake
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sometimes when I su to root I mistakenly type the root password right behind the su command, before hitting enter. That leads to the root password being written to the bash history in clear text and into /var/log/auth.log... (No passwd entry for user '<PASSWORD>')
Assuming normal, but not excessive paranoia - is there any way to recover from this situation safely, other than changing the root password?
E.g if I shred the bash history file and then run
Code:
history -c
and delete the critical lines from /var/log/auth.log - Does that sound reasonably safe? Or am I missing something important?
If you are that careless, don't use root.
Change the root password - that way logs are rendered irrelevant.
Use sudo.
I already changed the root password before even posting. The question was more out of curiosity.
And no, I don't want to use sudo except for special cases, plus it would not solve this particular problem, because the same mistake could happen when using sudo. And since you tend to have to type your password more often when using sudo, the likelihood of that happening would be even higher.
Granted, it wouldn't be the root password, but one with just as much power.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.