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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
05-20-2009, 07:24 AM
|
#1
|
LQ Newbie
Registered: May 2009
Posts: 1
Rep:
|
History logs
Hello,
How can I check, which command is fired or run by which user and at what time on linux server ? We can see history of commands using history command.
#history
Jeet N.
|
|
|
05-20-2009, 07:47 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
The history files (.bash_history for bash, .sh_history for ksh) are just command history files to make it easier to reuse the command. They aren't really designed for auditing which is what you want to do. You can do "strings" against such files for users (in their home directories) to get the commands but they won't have time stamps associated. Also since this history files roll over time they won't have all commands. It is a good place to look if you suspect a specific command was issued and want to find out who did it but it doesn't really prove it because you can't tell WHEN they did it. (Usually you don't have to prove it - people are generally shocked enough that you figured out it was them.)
To really do full auditing you need to plan for and turn on system accounting. This does quite a bit of logging so you'd need to plan for having a lot of space for that.
This page may help (I found it with a Google search):
http://www.faqs.org/docs/Linux-mini/...ccounting.html
|
|
|
05-20-2009, 09:48 AM
|
#3
|
Member
Registered: Feb 2009
Posts: 63
Rep:
|
I wonder what process accounting actually can provide when auditing from an accountability point of view? Does output from for instance lastcomm include relevant details like command arguments?
|
|
|
05-20-2009, 11:19 AM
|
#4
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
Don't know because I've never enabled this in all the years I've been doing UNIX/Linux. I know that some organizations do (or did) charge internal departments based on computer usage based on the accounting.
There is a rather interesting documentary (and book I think and maybe later a movie) called: The CIA, The KGB and Me. It was about a guy noticing discrepancies in such an audit that led him to discover that East German spies were using his system (and others) to hack into things like the Pentagon. I gather from what I saw in that you can get quite a bit of detail.
Reading the link I posted above might be a good start.
|
|
|
All times are GMT -5. The time now is 05:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|