LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 04-27-2011, 12:10 AM   #1
it_guy
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Rep: Reputation: 1
User activity Log in RHEL 5.2


Hi,
Is there any way to view the any user activity/ commands history and date,time in the system?
I look at the /var/log/secure but I can find only the login/ logout attempts and "history" command doesn't come with date/time that the user issue the commands. Any there any best practice to audit the user activities inside the system ? Pls. advise.
 
Old 04-27-2011, 12:41 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

By default the history log doesn't save date and time information but you can configure it to do so. Have a look at this site, it explains how to configure it. There's a lot of information about auditing in RHEL on the internet, do a search for 'auditd RHEL' and you'll get tons of resources. One of them that explains it in easy terminology and that gives you the basics to get started is this one.

Kind regards,

Eric
 
1 members found this post helpful.
Old 04-27-2011, 01:51 AM   #3
it_guy
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Original Poster
Rep: Reputation: 1
history command from day 1 to last

Hi EricTRA,
Really appreciate your info. I managed to do it. But only the last 200+ ( for 1 page only )command only seen. If I want to see from command start day 1 to last command , how would I able to configure it accordingly? And I can't use " | more " parameter in order to see page by page from day 1 to last command. Pls. advise. Thanks a lot.
 
1 members found this post helpful.
Old 04-27-2011, 01:58 AM   #4
it_guy
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Original Poster
Rep: Reputation: 1
history command from day 1 to last

Hi EricTRA,
Really appreciate your info. I managed to do it. But only the last 200+ ( for 1 page only )command only seen. If I want to see from command start day 1 to last command , how would I able to configure it accordingly? And I can't use " | more " parameter in order to see page by page from day 1 to last command. Pls. advise. Thanks a lot.
 
Old 04-27-2011, 02:07 AM   #5
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
This is a cool info:
http://mywiki.wooledge.org/BashFAQ/088
http://www.debian-administration.org/articles/543

Last edited by micxz; 04-27-2011 at 02:10 AM. Reason: add link
 
Old 04-27-2011, 02:13 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by it_guy View Post
Hi EricTRA,
Really appreciate your info. I managed to do it. But only the last 200+ ( for 1 page only )command only seen. If I want to see from command start day 1 to last command , how would I able to configure it accordingly? And I can't use " | more " parameter in order to see page by page from day 1 to last command. Pls. advise. Thanks a lot.
Hello,

You're welcome. I assume you're referring to the history. Have a look at this site on what settings you can change. Normally your history, when using the default settings, would only keep something like the last 500 commands, including duplicates. So if you want to keep track of a longer period (more commands) you'll have to configure it as indicated in the site I pointed to (and also the one pointed out by micxz. If you want to see history from day one as you state then you're out of luck. If not in the history then you can forget that I'm afraid.

Kind regards,

Eric

Last edited by EricTRA; 04-27-2011 at 02:14 AM. Reason: Forgot the link
 
Old 04-29-2011, 12:54 AM   #7
it_guy
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Original Poster
Rep: Reputation: 1
Audit log for "rcp" file transfer

Hi Eric and micxz,
Thanks for your quite helpful information and I was exploring these days and utilize for my job.But I am wondering where I am able to view the "rcp" file transfering attempts from server "A" to my server "B" inside /var/log/ . So far I cannot find any of the /var/log/messages and /var/log/secure logs . And am I able to view the successful and fail "rcp" file transfer attempts to my sever log file ? Pls. advise.

Thanks,
 
Old 04-29-2011, 01:15 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

I've never worked with rcp to copy files from one server to another, I always use scp which is a lot more secure I believe. But I've found this on the internet that might be helpful:
Quote:
Look in the .rhost files in ~user home directories and /etc/auth.conf
Kind regards,

Eric
 
Old 04-29-2011, 03:58 AM   #9
it_guy
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Original Poster
Rep: Reputation: 1
rcp time out setting

Hi,
Thanks. But for project requirement and offline usage , we need to use "rcp" command instead of "scp". Do you have any idea where should I configure the time out setting for "rcp"?
 
Old 05-05-2011, 05:47 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Since this thread was referenced elsewhere and because of some of the replies I would like to restore Balance to the Force and add a few posts for meditation. Unless BaSH changed the history list is only active during interactive shells and as catkin remarks shell history is a user convenience, not an audit tool. Here's a short overview of standard accounting features, auditing options and considerations. Also see this, and another overview and for completeness sake pam_tty_audit and an example of Auditd executable logging

In closing some logging examples FWIW:
- Rootsh: http://www.linuxquestions.org/questi...7/#post2980353
- FUSE LoggedFS: http://www.linuxquestions.org/questi...5/#post4001946
- pam_tty_audit.so a slightly doctored output of /etc/pam.d/login with "session required pam_tty_audit.so disable=* enable=root" set (left) and without (right) showing a root login on TTY1, running 'ps' and logging out:
Code:
~]$ diff -y auditlog_secure_pam_tty_audit auditlog_secure_NO_pam_tty_audit -W 260
==> /var/log/audit/audit.log <==                                                                                                ==> /var/log/audit/audit.log <==
node= type=USER_AUTH msg=audit(..): user pid=5784 msg='PAM: authentication acct="root" : exe="/bin/login" (hostname=?, addr=? | node= type=USER_AUTH msg=audit(..): user pid=5831 msg='PAM: authentication acct="root" : exe="/bin/login" (hostname=?, addr=?
node= type=USER_ACCT msg=audit(..): user pid=5784 msg='PAM: accounting acct="root" : exe="/bin/login" (hostname=?, addr=?, te | node= type=USER_ACCT msg=audit(..): user pid=5831 msg='PAM: accounting acct="root" : exe="/bin/login" (hostname=?, addr=?, te
node= type=LOGIN msg=audit(..): login pid=5784 old ses= new ses=85                                                            | node= type=LOGIN msg=audit(..): login pid=5831 old ses= new ses=88
node= type=USER_ROLE_CHANGE msg=audit(..): user pid=5784 msg='pam: default-context=root:system_r:unconfined_t:s0-s0:c0.c1023  | node= type=USER_ROLE_CHANGE msg=audit(..): user pid=5831 msg='pam: default-context=root:system_r:unconfined_t:s0-s0:c0.c1023 
node= type=USER_START msg=audit(..): user pid=5784 msg='PAM: session open acct="root" : exe="/bin/login" (hostname=?, addr=?, | node= type=USER_START msg=audit(..): user pid=5831 msg='PAM: session open acct="root" : exe="/bin/login" (hostname=?, addr=?,
node= type=CRED_ACQ msg=audit(..): user pid=5784 msg='PAM: setcred acct="root" : exe="/bin/login" (hostname=?, addr=?, termin | node= type=CRED_ACQ msg=audit(..): user pid=5831 msg='PAM: setcred acct="root" : exe="/bin/login" (hostname=?, addr=?, termin
node= type=USER_LOGIN msg=audit(..): user pid=5784 msg='op=login id=0 exe="/bin/login" (hostname=?, addr=?, terminal=tty1 res | node= type=USER_LOGIN msg=audit(..): user pid=5831 msg='op=login id=0 exe="/bin/login" (hostname=?, addr=?, terminal=tty1 res
node= type=TTY msg=audit(..): tty pid=5791 uid=0 auid=0 major=4 minor=1 comm="bash" data=70730D                               <
node= type=USER_TTY msg=audit(..): user pid=5791 uid=0 auid=0 msg="ps"                                                        <
node= type=TTY msg=audit(..): tty pid=5791 uid=0 auid=0 major=4 minor=1 comm="bash" data=04                                   <
node= type=CRED_DISP msg=audit(..): user pid=5784 msg='PAM: setcred acct="root" : exe="/bin/login" (hostname=?, addr=?, termi | node= type=CRED_DISP msg=audit(..): user pid=5831 msg='PAM: setcred acct="root" : exe="/bin/login" (hostname=?, addr=?, termi
node= type=USER_END msg=audit(..): user pid=5784 msg='PAM: session close acct="root" : exe="/bin/login" (hostname=?, addr=?,  | node= type=USER_END msg=audit(..): user pid=5831 msg='PAM: session close acct="root" : exe="/bin/login" (hostname=?, addr=?,
 
1 members found this post helpful.
  


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
Server Activity Log hmutual2 Linux - Newbie 4 02-10-2011 04:20 AM
log activity in samba packets Linux - Software 1 11-05-2008 04:24 AM
how to stop log activity blassmegod Linux - Desktop 9 07-31-2007 07:25 AM
activity log linuxhippy Slackware 5 11-16-2005 06:55 PM
how to log port activity irfanhab Linux - General 4 06-18-2005 12:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 06:08 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
Open Source Consulting | Domain Registration