make .bash_history uneditable, but still functional O_o
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.
make .bash_history uneditable, but still functional O_o
I want to make .bash_history for all my users uneditable by anyone but root. obviously changing the owner to root makes it undeleteable, but they can still modify it. if I remove write permissions, then the file doesn't even do it's job. I swear I saw this done once on a wargames server somewhere... how can I achieve this?
You might try the "append-only" extended attribute ('man chattr') but I'd rather use a shell wrapper like Rootsh instead. This way you keep track of history completely outside of the users realm of influence.
awesome, chattr +a works good enough for this situation.
one other thing I'd like to figure out how to do is make a file unREADable, but still appendable. I've seen this done before, but don't see the options in `man chattr`
Note there may be a difference between what you think is "good enough" and what would be appropriate, depending on the situation.
the users of my server arent given root access. they also aren't even able to log in. passwords are randomized (even i dont know them), account is disabled from any kind of login (remote or local) aside from `su`ing, ssh keys are the only way to log in, it will only let users execute one paticular command, and then disconnects.
and the users are all pretty computer illiterate, using windows and a gui.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.