apunkabollywood
asked on
I want to record all the commands ran by any user(or root) in Linux
I need this mechanism via bash script or any RHEL Package.
Turn on auditing and require sudo (logging the commands) for all privileged commands even if you don't require knowing the root password.
Like _jesper_ said, I think auditing is the way to go.
ASKER
I found the solutions !
https://www.experts-exchange.com/OS/Linux/Distributions/A_683-Auditing-user-sessions.html
One more thing I want to send/save the files generated from script command to an oracle database. How i can achieve that ?
https://www.experts-exchange.com/OS/Linux/Distributions/A_683-Auditing-user-sessions.html
One more thing I want to send/save the files generated from script command to an oracle database. How i can achieve that ?
ASKER
One more thing, how I can get rid of garbage created by the interactive commands like vi from script command.
What do you mean by "garbage"? Can you give an example?
snoopy from epel does it. How you pump syslog to oracle is another question. Mostly syslog servers have semimaintained oracle modules that you need to fix before using.
ASKER
Hi All,
@jesper - from garbage i mean ASCII code generated in the files while recording shell via script command.
@gheist - Thanks . snoopy is great tool, I will look on it and I want these logs piped to oracle.
I have a blog , do you think it can work what i need ?
http://blog.ronnyegner-consulting.de/2009/11/11/logging-syslog-and-database-audit-messages-to-an-oracle-database-with-rsyslog/
Thanks All !
@jesper - from garbage i mean ASCII code generated in the files while recording shell via script command.
@gheist - Thanks . snoopy is great tool, I will look on it and I want these logs piped to oracle.
I have a blog , do you think it can work what i need ?
http://blog.ronnyegner-consulting.de/2009/11/11/logging-syslog-and-database-audit-messages-to-an-oracle-database-with-rsyslog/
Thanks All !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
cat /usr/home/%username/.bash_
You'll need to update the path for the user depending on what kernel version you are using.
Also you will need to run the cat as a root user or with sudo depending on kernel, so that you can read other user's bash_history files.
Easy way to figure out where the history files are located is my doing a 'locate history', if you don't have locate installed you can install mlocate, then run an updatedb; after you have done that, retry running the 'locate history' command.
Also: Is this something that you want to do once? or constantly update? If you want to constantly update the file, use the >> if you want to rewrite the file every time use > instead.