LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-03-2009, 03:34 PM   #1
caibbor
LQ Newbie
 
Registered: Dec 2009
Posts: 27

Rep: Reputation: 0
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?
 
Old 12-03-2009, 03:48 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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.
 
Old 12-03-2009, 04:35 PM   #3
caibbor
LQ Newbie
 
Registered: Dec 2009
Posts: 27

Original Poster
Rep: Reputation: 0
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`
 
Old 12-03-2009, 04:58 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by caibbor View Post
works good enough
Note there may be a difference between what you think is "good enough" and what would be appropriate, depending on the situation.


Quote:
Originally Posted by caibbor View Post
one other thing I'd like to figure out how to do is make a file unREADable, but still appendable.
See 'man chmod'?

Last edited by unSpawn; 12-03-2009 at 05:01 PM.
 
Old 12-03-2009, 05:19 PM   #5
caibbor
LQ Newbie
 
Registered: Dec 2009
Posts: 27

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
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.

Quote:
Originally Posted by unSpawn View Post
See 'man chmod'?
hah, will do

Last edited by caibbor; 12-03-2009 at 07:02 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.bash_history t3gah Linux - Software 2 05-05-2005 03:45 AM
Can i make my logitech mx510 profesional gaming mouse fully functional? how? DesyphER Linux - Software 4 02-26-2005 02:55 AM
bash_history linj Linux - Software 6 08-08-2003 10:13 AM
.bash_history gone togeno Linux - Security 3 06-30-2003 07:10 AM
.bash_history question iceman47 Linux - Security 4 06-06-2003 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration