- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Logging commands executed in shell
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
Discussions
Discussions
Discussions
Forums
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
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
тАО08-10-2005 04:20 AM
тАО08-10-2005 04:20 AM
Obviously there is .sh_history and .bash_history but it not very accurate. (If you just close the putty window or login simultaneously with same account it doesn't updated well.)
And I also want to see the time when a given command was executed which not included in shell history files.
I would appreciate any ideasтАж
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2005 04:27 AM
тАО08-10-2005 04:27 AM
Re: Logging commands executed in shell
pbrun ksh # (or shell of your choice)
from this moment on, every keystroke they make gets recorded in PB logs. It is not a free product, but has very good logging capabilities as well as delegation of authority features.
visit :
http;//www.symark.com
for more information.
HTH
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2005 04:35 AM
тАО08-10-2005 04:35 AM
Re: Logging commands executed in shell
man script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2005 04:39 AM
тАО08-10-2005 04:39 AM
Re: Logging commands executed in shell
(Or something open source with GPL license.)
BTW is it possible to do this with HP-UX own accounting mechanism? Man acct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2005 04:43 AM
тАО08-10-2005 04:43 AM
Re: Logging commands executed in shell
# Set up shell history file
myterm=`ps | tail -1 | awk '{print $2}'`
export HISTFILE=$HOME/.sh_history.`who -R|grep \$myterm|awk '{print $6}'
|sed s/\(//|sed s/\)//`
But it doesn't log timestamp for commands. And it not really working if you just close your teminal. It just solve the problem of simultaneous login.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2005 04:45 AM
тАО08-10-2005 04:45 AM
Solutionhttp://www.mayoxide.com/audenable/
Another alternative is documented here:
http://honeypots.sourceforge.net/modified_script.html
I started porting this to HP-UX some time ago (can give you my sources if you want) but found it to be too risky for corner cases.
Olivier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2005 04:49 AM
тАО08-10-2005 04:49 AM
Re: Logging commands executed in shell
# Set History File
HISTFILE=/home/root/.sh_history_"${HST}"_"${USR}"-as-"${NAME}"_`date +%y%m%d.%H%M%S_$$`
export HISTFILE
The 1-liner you posted just recently can have the date functionality included with it. This way you get the date/time stamps as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2005 05:12 AM
тАО08-10-2005 05:12 AM
Re: Logging commands executed in shell
I exactly looking for something like this. I'll have a look at these tomorrow. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2005 05:14 AM
тАО08-10-2005 05:14 AM
Re: Logging commands executed in shell
but I want a timestamp when e.g. the "ls -lR" was executed by user xyz.
What you wrote here just append a timestamp to the history file.