- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Way to log who removed file?
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
11-27-2001 07:11 AM
11-27-2001 07:11 AM
Way to log who removed file?
by users and applications on a hp-ux 10.20 and
11.0 system?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2001 07:15 AM
11-27-2001 07:15 AM
Re: Way to log who removed file?
Both ways give you an option to monitor files and trace who removed a file
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2001 07:27 AM
11-27-2001 07:27 AM
Re: Way to log who removed file?
1. Start accounting. Using this you can determine the users that used rm commands and the number of times they used.
2. Or start auditing and audit events like delete, modaccess etc.,. But this needs your system to be converted as trusted.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2001 07:32 AM
11-27-2001 07:32 AM
Re: Way to log who removed file?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2001 08:00 AM
11-27-2001 08:00 AM
Re: Way to log who removed file?
The easiest way is to track their history files. ( .sh_history in the homedirectories; this assumes setting HISTFILE=$HOME/.sh_history in their .profile file). Ofcourse users have the option of deleting their history files too ;-)
Accounting and other tools to log these actions involves more space, resources. So, the question comes back to - prevention.
Set the appropriate directory & file permissions which authorises users to live within their zones and not go around making mischief. Remember to set the umask too in the .profile file, which imposes a stricter definition of file permissions for new files.
HTH
raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2001 08:40 AM
11-27-2001 08:40 AM
Re: Way to log who removed file?
#!/sbin/sh
# log all rm activities
MYID=$(/usr/bin/id -nu)
FIRST150=$(echo $@ | /usr/bin/cut -c 1-150)
/usr/bin/logger -t "rm-trace" -p user.warn "$MYID: rm $FIRST150"
exec /usr/bin/rm.real $@
and similarly for mv:
#!/sbin/sh
# log all mv activities
MYID=$(/usr/bin/id -nu)
FIRST150=$(echo $@ | /usr/bin/cut -c 1-150)
/usr/bin/logger -t "mv-trace" -p user.warn "$MYID: mv $FIRST150"
exec /usr/bin/mv.real $@
To install the wrappers, cut-n-paste the above scripts into something like rmwrapper amd mvwrapper, then:
# cp -p /usr/bin/rm /usr/bin/rm.real
# cp -p /sbin/rm /sbin/rm.real
# cp rmwrapper /usr/bin/rm
# cp rmwrapper /sbin/rm
# chmod 555 /usr/bin/rm /sbin/rm
# chown bin:bin /usr/bin/rm /sbin/rm
and for mv:
# cp -p /usr/bin/mv /usr/bin/mv.real
# cp -p /sbin/mv /sbin/mv.real
# cp mvwrapper /usr/bin/mv
# cp mvwrapper /sbin/mv
# chmod 555 /usr/bin/mv /sbin/mv
# chown bin:bin /usr/bin/mv /sbin/mv
Now test the command by:
# touch xyzabc
# mv xyzabc abcxyz
# rm abcxyz
# tail /var/adm/syslog/syslog.log
You should see entries like:
Nov 27 11:38:18 freedom mv-trace: root: mv xyzabc abcxyz
Nov 27 11:38:27 freedom rm-trace: root: rm abcxyz
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2001 09:33 AM
11-27-2001 09:33 AM
Re: Way to log who removed file?
-Sri