- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Looking at a shell ENV
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
12-18-2001 06:06 AM
12-18-2001 06:06 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:09 AM
12-18-2001 06:09 AM
Re: Looking at a shell ENV
Or look at ~userid/.profile , .env , .login
Might find the answer there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:13 AM
12-18-2001 06:13 AM
Re: Looking at a shell ENV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:14 AM
12-18-2001 06:14 AM
Re: Looking at a shell ENV
tail -f ~userid/.sh_history
You could then catch them out in the act.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:34 AM
12-18-2001 06:34 AM
Re: Looking at a shell ENV
With lsof or even fuser, you should be able to find all files open under this userid.
And locate the history
this may however be laborious.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:35 AM
12-18-2001 06:35 AM
Re: Looking at a shell ENV
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:44 AM
12-18-2001 06:44 AM
Re: Looking at a shell ENV
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:50 AM
12-18-2001 06:50 AM
Re: Looking at a shell ENV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:51 AM
12-18-2001 06:51 AM
Re: Looking at a shell ENV
http://hpux.asknet.de/hppd/hpux/Sysadmin/lsof-4.55/
It doesn't require a reboot, it's just a binary.
Then "lsof | grep history", providing they didn't rename their history file, but you can do a "lsof | grep
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 06:54 AM
12-18-2001 06:54 AM
Re: Looking at a shell ENV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 07:08 AM
12-18-2001 07:08 AM
Re: Looking at a shell ENV
# tusc -s 5
This will print out all the open system calls made by the process.
Another one of my personal favorites:
# tusc -s 3 -d 0
will print out all read system calls on stdin. So you can basically watch the users keystrokes as they are typed. Its always good to inform them of their spelling mistakes without having them read out what they have just typed over the phone :)
Cheers,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 07:15 AM
12-18-2001 07:15 AM
Re: Looking at a shell ENV
Three additional methods for tracing:
1) Enable auditing of user via sam. You will need to convert your OS to trusted before auditing can be performed.
2) Run account management via acctcom, runacct etc.
3) Use expect scripting to log all screen output of a user's login shell (I have seen it done on one system).
Hope this helps. Regards.
Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 10:28 AM
12-18-2001 10:28 AM
Re: Looking at a shell ENV
I like that command, That will help a lot
THANKS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 11:28 AM
12-18-2001 11:28 AM
Re: Looking at a shell ENV
it looks like the tusc command has a -e option to show env vars, but I can't seem to get it to work right. Either it's not what I think it is, or I am doing something wrong, any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 12:01 PM
12-18-2001 12:01 PM
Re: Looking at a shell ENV
ll -t ~user_name
The files at the top of the list were recently modified.
However, if this (ab)user is really hacing and wants no one looking over the shell commands, the HISTFILE variable may have been unset in which case the history file is no longer used.
The readonly suggestion probably makes a lot of sense, and you may have to append your company's security policy (you do have one don't you?) to state that "shell history files are required for system management and may not be bypassed".
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2001 12:11 PM
12-18-2001 12:11 PM
Re: Looking at a shell ENV
I am acutually running a find on all files that he owns. This user has been caught twice so I think he is definaltly hidding his actions, the tusc is working good, just a little cumbersome to try and read. There is nothing in the home directory, but I can see he is running commands.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2001 01:15 AM
12-19-2001 01:15 AM
Re: Looking at a shell ENV
You're right - it looks like it will display them only on an exec*() system call though. Try running
# tusc -f -p -e
against a shell, then run a command in the traced shell. After the forked process does an exec you will see the environment variables that are exported.
I guess that would mean the real answer to your question is to run:
# tusc -f -p -e -s 59
That will trace the execve() system calls made by child processes of the users shell and print out the environment variables. See /usr/include/sys/scall_define.h for all the system call numbers.
Cheers,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2001 05:47 AM
12-19-2001 05:47 AM