- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to trace command issued by unix account
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
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
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
тАО09-03-2008 06:59 AM
тАО09-03-2008 06:59 AM
Our hp server is 11i, and for security issues, are there any method to trace any command issued by unix account . Thanks a lot.
Best Regards
Eric
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 07:07 AM
тАО09-03-2008 07:07 AM
SolutionFirst you configure the unix user account .profile or /etc/profile to set up a HISTFILE variable.
Then the commands typed are tracked.
From there you can take other avenues of investigation, depending on what you find.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 09:22 AM
тАО09-03-2008 09:22 AM
Re: how to trace command issued by unix account
Turn on system accounting for the user(s).
either use SAM or read the Admin guide @ docs.hp.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2008 01:53 AM
тАО11-13-2008 01:53 AM
Re: how to trace command issued by unix account
Thank you very much.
1.If i set up the variable in /etc/profile, does all new created user will be effected ?
2. does there any size limit on this file .sh_history ? if yes, can i setup let it unlimited size ?
3. this file seems can be modified, does there are any mechod to let it to be readonly ?
Appreciatively
Best Regards
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2008 02:38 AM
тАО11-13-2008 02:38 AM
Re: how to trace command issued by unix account
Yes , will effect if you configure
under /etc/profile
.profile --> refer to indivual user_account profile
/etc/profile --> refer to common profile for all User accounts in the System
2. does there any size limit on this file .sh_history ? if yes, can i setup let it unlimited size ?
Yes you can
Acutally NO size_limit
see below example
export HISTFILE=$HOME/.sh_history
HISTSIZE=1000
3. this file seems can be modified, does there are any mechod to let it to be readonly ?
by default its "read-only" file , but only root user can edit,
ll /etc/profile
-r--r--r-- 1 bin bin 2729 Aug 30 2007 /etc/profile
-r--r--r-- 1 ibmadm1 ibmsupt 457 Aug 25 2001 .profile
hope have answered your Question ..:)
Thanks,
Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2008 08:49 AM
тАО11-13-2008 08:49 AM
Re: how to trace command issued by unix account
Yes, all users using a real shell.
>2. any size limit on this file .sh_history?
None documented. But I find after either 32K or 64K commands, the files become corrupted. (That's using one file for several machines.)
>3. this file seems can be modified, is there any method to let it to be readonly?
Well, if you can't write to $HISTFILE, you can't save your history.
You can make the variable readonly: readonly HISTFILE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2008 08:53 AM
тАО11-13-2008 08:53 AM
Re: how to trace command issued by unix account
Shell history was not really designed with auditing in mind.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2008 08:59 AM
тАО11-13-2008 08:59 AM
Re: how to trace command issued by unix account
2. does there any size limit on this file .sh_history ? if yes, can i setup let it unlimited size ?
Yes you can
Acutally NO size_limit
see below example
export HISTFILE=$HOME/.sh_history
HISTSIZE=1000
.. you'll have a limit of 1000 commands stored!
Maybe you'll need a script then to copy the contents to another (text-)file.
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2008 09:07 AM
тАО11-13-2008 09:07 AM
Re: how to trace command issued by unix account
Actually you have many more than 1000 commands in the file but history will only provide 1000. (Perhaps this is why the file gets corrupted?)
If I can't find the command in the history, I grep $HISTFILE to find it. Note it is a "binary" file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 07:27 AM
тАО11-14-2008 07:27 AM
Re: how to trace command issued by unix account
Thanks for your kind input. :-)
One another question :
the file .sh_history seems can be modified by userself right ? have any method to let user cannot modify it ? because if user can modify it, then this file .sh_history seems lose the audit function ...
Best Regards
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 07:43 AM
тАО11-14-2008 07:43 AM
Re: how to trace command issued by unix account
If the user is not allowed to modify the .sh_history file, then how will the history be kept?
The user HAS to have write ability to the file in order for the commands they run to be written to it.
>>then this file .sh_history seems lose the audit function ...
As I said above, the shell history was NOT designed to function as an audit tool. It was designed to provide users the ability to recall commands so they don't have to type the same thing over and over.
You are trying to use the shell history for something other than its true purpose. While it can be used for rudimentary auditing, it really is a poor choice.