Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

script to monitor who logged in and the commands he execute

Mohammad ShaddadNov 21 2018 — edited Nov 25 2018

Hi All

Kindly, I need to monitor Linux for 2 actions (to be saved in a log file every minute)

-1- who logged in (PC name) and when (date and time)

-2- what are the commands he execute (who execute, the command, and when)

considering the following:

- some users may change history size to 0 before they execute the command

- (last, w or who) statement may show the IP address only, also user may clean the entries from default log

I was trying to build shell to copy (history and w) commands outputs to file every minute, then to clean history, but it does not work

hope if you have ready script

Thanks ...

Comments
Post Details
Added on Nov 21 2018
4 comments
447 views