Register
It is currently Fri Oct 31, 2014 4:55 pm

script to move the contents of .bash_history all users


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Tue Sep 16, 2008 8:25 am   

Joined: Sun Sep 14, 2008 3:36 am
Posts: 5
hi all,
I need a script to move the contents of .bash_history all users of the sytem to a new file...
please post the reply as soon as possible...
thanks alll.......


Top
 Profile  
 PostPosted: Wed Sep 17, 2008 10:16 pm   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 229
Location: London - UK
very basic, it'll copy users history file to /tmp/username

Code:
destinationdir=/tmp
for iuser in $(ls /home)
do
  cp /home/$iuser/.bash_history $destinationdir/$iuser
done


Doesn't include root's history file and will almost certainly require root access to run.

I remember you from before and please note that if you need stuff like this for security you'll need a security expert, for example 'history' is very easy to circumvent. Building up a few scripts like this will be a waste of time and will prevent nothing. You'd likely be better off using chkrootkit, tripwire and other similar tools.

If you actually want improved security then hire someone whom knows how to approach it properly.

:)


Top
 Profile  
 PostPosted: Thu Sep 18, 2008 11:45 am   

Joined: Sun Sep 14, 2008 3:36 am
Posts: 5
hi DarthWavy,
Thank u very much first of all for the script and thanks a lot for ur valuable suggestion.
I'm trying to use Chkrootkit....Actually this for building a profile based Intrusion Detection system.
Do u have any Idea which can help us it is actually our final year project.....
thanks again....


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP