LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-28-2012, 01:33 AM   #1
bala.linuxtech
Member
 
Registered: Nov 2012
Location: Bangalore
Distribution: RHEL and Centos
Posts: 80

Rep: Reputation: Disabled
How to Redirect Local User Historys ?


Hi all

I am Using RHEL 5.4 Box., I would like to redirect my Local users histories ( /home/.bash_history) to /root/users_history file..

Is it possible to redirect ??

Guyz , Please suggest me your ideas!!

Regards
Bala
 
Old 11-28-2012, 02:31 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
The problem is root's home dir is
Code:
dr-xr-x---.  17 root root  4096 Nov 28 17:27 root
so even adding a world writable file eg
Code:
-rw-r--rw-. 1 root root          0 Nov 28 17:27 t.t
you still get
Code:
 echo 'test' >/root/t.t
bash: /root/t.t: Permission denied
allowing write to root's home dir is a really bad idea.

Why would you want this anyway?
 
2 members found this post helpful.
Old 11-28-2012, 03:01 AM   #3
bala.linuxtech
Member
 
Registered: Nov 2012
Location: Bangalore
Distribution: RHEL and Centos
Posts: 80

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
The problem is root's home dir is
Code:
dr-xr-x---.  17 root root  4096 Nov 28 17:27 root
so even adding a world writable file eg
Code:
-rw-r--rw-. 1 root root          0 Nov 28 17:27 t.t
you still get
Code:
 echo 'test' >/root/t.t
bash: /root/t.t: Permission denied
allowing write to root's home dir is a really bad idea.

Why would you want this anyway?

Chris

Good., I know very well that its very bad to redirect to /root/ ,
Here that Destination(/root/user_history) file is doesn't matter .. i would like to know is it possible to redirect, if its possible then how ?

Chris ., pls suggest me is it possible to redirect that histories to some where ?


Regards
Bala
 
Old 11-28-2012, 03:47 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
You could probably symlink them to /tmp, but I'm not sure you wouldn't have issues if you try to put them all in the same file.
Again, why do this?
 
1 members found this post helpful.
Old 11-29-2012, 12:09 AM   #5
bala.linuxtech
Member
 
Registered: Nov 2012
Location: Bangalore
Distribution: RHEL and Centos
Posts: 80

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by chrism01 View Post
You could probably symlink them to /tmp, but I'm not sure you wouldn't have issues if you try to put them all in the same file.
Again, why do this?
chris

Thanks ., Here I have a order to save all Local user history's, that is why i am going on this ... here i am going to redirect all local users history's to each file under /tmp ., is symlink method will helpful for this ? is there any other way to redirect ?

Once again thanks Chris !

Regards
Bala
 
Old 11-29-2012, 01:22 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Well it'd be easier to just create a cron job to back them up every day.
Note that the user has to be able to write to the history file, which also means that he can empty them.

This is not a secure way of tracking the user.
If you are after a secure method, you could have a look at rootsh http://sourceforge.net/projects/rootsh/

Last edited by chrism01; 11-29-2012 at 01:24 AM.
 
Old 11-29-2012, 01:26 AM   #7
bala.linuxtech
Member
 
Registered: Nov 2012
Location: Bangalore
Distribution: RHEL and Centos
Posts: 80

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by chrism01 View Post
Well it'd be easier to just create a cron job to back them up every day.
Note that the user has to be able to write to the history file, which also means that he can empty them.
This is not a secure way of tracking the user.

Yes chris., that is happening here .. some users deleting their history's very often .. what should i do ? how to redirect the user history's in effective manner ?

Regards
bala.linuxtech
 
Old 11-29-2012, 01:42 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
As I said, look at rootsh
 
Old 11-29-2012, 02:08 AM   #9
bala.linuxtech
Member
 
Registered: Nov 2012
Location: Bangalore
Distribution: RHEL and Centos
Posts: 80

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
As I said, look at rootsh
Yes sure ..

Thanks Chris
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
iptables redirect local ip traffic roof-us Linux - Networking 3 12-07-2011 10:56 AM
Redirect local port chenja Linux - Enterprise 1 09-29-2011 02:23 PM
Squid download file , check for viruses and redirect user to a local page cioannou Linux - Server 0 06-17-2011 08:03 AM
[SOLVED] how to redirect output from remote to local brownie_cookie Linux - Newbie 30 04-01-2011 10:09 AM
local null route / redirect MikeQ Linux - Server 2 08-17-2009 04:11 AM


All times are GMT -5. The time now is 08:19 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration