- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Audit root
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 01:44 AM
07-29-2004 01:44 AM
I need to audit the access and commands executed from root user, how can I do this ?
And if I need to audit another users ??
I have hp-ux 11.0
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 02:03 AM
07-29-2004 02:03 AM
Solutionexport HISTFILE=/root/.sh_history.$$
LOGINID=`who am i 2>/dev/null |cut -f1 -d" "`
if [ "$LOGINID" != "" ]
then
who -m -u >/var/adm/security/rootlogs/login.$$
fi
unset LOGINID
This will create the history file as .sh_history.xxxx.
xxxx-is the shell pid.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 02:08 AM
07-29-2004 02:08 AM
Re: Audit root
export I_AM=`who -m | awk '{print $1}'`
export LOGIN_DATE=`date +%d%m%y`
export HISTFILE=/var/tmp/history/.sh_history.$I_AM.$LOGIN_DATE
This gives me a list of root commands in history files for any user on a given date
eg: if I was to use my test ID to switch to root today, I'd end up with a file
/var/tmp/history/.sh_history.cwtest.290704
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 03:01 AM
07-29-2004 03:01 AM
Re: Audit root
# Set up logging
HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`
date >>$HISTFILE
export HISTFILE
HISTSIZE=500
export HISTSIZE
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 05:43 AM
07-29-2004 05:43 AM
Re: Audit root
Make a history file and size with HISTFILE and HISTSIZE options.
Use HISTFILE as meanful to identify the users and their logins. Use this settings after the export of $HOME variable to that user.
HISTFILE=$HOME/.sh_history_$(id -un).$$
export $HISTFILE
HISTSIZE=1000
export $HISTSIZE
echo who >> $HISTFILE
You can identify number of logins which made by the user on that day with that PID informations. More history files will be created with PID's.
find / -name ".sh_history_*" -exec ls {} \; | cut -d "." -f 1 | awk '{ print "mv "$1".* "$1 }' | sh
It will redirect all history of user's to $HOME/.sh_history file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 06:09 AM
07-29-2004 06:09 AM
Re: Audit root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2004 12:30 AM
08-02-2004 12:30 AM