<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Looking at a shell ENV in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632345#M849909</link>
    <description>Ahh sorry, misread the question... only way I can think of to find their shell history file is with lsof.  &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve</description>
    <pubDate>Tue, 18 Dec 2001 14:44:51 GMT</pubDate>
    <dc:creator>Steven Gillard_2</dc:creator>
    <dc:date>2001-12-18T14:44:51Z</dc:date>
    <item>
      <title>Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632339#M849903</link>
      <description>Anyone know of a way to list the environment vairiables of a users active shell.  I have a user that is screwing around and I want to see where he redirected his history (I think he does on the command line, after his profile runs).  The only thing I can think of is to force a core a dump on the shell, but I would rather be a little quieter.</description>
      <pubDate>Tue, 18 Dec 2001 14:06:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632339#M849903</guid>
      <dc:creator>Jeff Machols</dc:creator>
      <dc:date>2001-12-18T14:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632340#M849904</link>
      <description>As root you could su - tothe userid and look at the env there.&lt;BR /&gt;&lt;BR /&gt;Or look at ~userid/.profile , .env , .login&lt;BR /&gt;Might find the answer there.</description>
      <pubDate>Tue, 18 Dec 2001 14:09:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632340#M849904</guid>
      <dc:creator>Alan Casey</dc:creator>
      <dc:date>2001-12-18T14:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632341#M849905</link>
      <description>The problem is, he is setting these by hand after he logs in</description>
      <pubDate>Tue, 18 Dec 2001 14:13:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632341#M849905</guid>
      <dc:creator>Jeff Machols</dc:creator>
      <dc:date>2001-12-18T14:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632342#M849906</link>
      <description>the only other thing I can suggest id to enable commands history for the user, and monitor them:&lt;BR /&gt;&lt;BR /&gt;tail -f ~userid/.sh_history&lt;BR /&gt;&lt;BR /&gt;You could then catch them out in the act.</description>
      <pubDate>Tue, 18 Dec 2001 14:14:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632342#M849906</guid>
      <dc:creator>Alan Casey</dc:creator>
      <dc:date>2001-12-18T14:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632343#M849907</link>
      <description>There may be a way to find if his history has been redirected fro his current shell.&lt;BR /&gt;&lt;BR /&gt;With lsof or even fuser, you should be able to find all files open under this userid.&lt;BR /&gt;And locate the history&lt;BR /&gt;&lt;BR /&gt;this may however be laborious.</description>
      <pubDate>Tue, 18 Dec 2001 14:34:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632343#M849907</guid>
      <dc:creator>Alan Casey</dc:creator>
      <dc:date>2001-12-18T14:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632344#M849908</link>
      <description>How about the "set" command with no arguments. Its built into the shell, so see the sh-posix(1) man page for details.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 18 Dec 2001 14:35:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632344#M849908</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2001-12-18T14:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632345#M849909</link>
      <description>Ahh sorry, misread the question... only way I can think of to find their shell history file is with lsof.  &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 18 Dec 2001 14:44:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632345#M849909</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2001-12-18T14:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632346#M849910</link>
      <description>Do this:&lt;BR /&gt;&lt;BR /&gt;readonly HISTFILE&lt;BR /&gt;readonly HISTSIZE&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 18 Dec 2001 14:45:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632346#M849910</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-12-18T14:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632347#M849911</link>
      <description>Thanks Harry, put that in /etc/profile. At least all new logins will be able to be monitored</description>
      <pubDate>Tue, 18 Dec 2001 14:50:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632347#M849911</guid>
      <dc:creator>Jeff Machols</dc:creator>
      <dc:date>2001-12-18T14:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632348#M849912</link>
      <description>Steven makes a good point, download lsof (if you don't already have it) from:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.asknet.de/hppd/hpux/Sysadmin/lsof-4.55/" target="_blank"&gt;http://hpux.asknet.de/hppd/hpux/Sysadmin/lsof-4.55/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It doesn't require a reboot, it's just a binary.&lt;BR /&gt;&lt;BR /&gt;Then "lsof | grep history", providing they didn't rename their history file, but you can do a "lsof | grep &lt;USERNAME&gt;".&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;/USERNAME&gt;</description>
      <pubDate>Tue, 18 Dec 2001 14:51:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632348#M849912</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-12-18T14:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632349#M849913</link>
      <description>tried that, it looks like the file isn't always open (tried it on myself).  It looks like ksh just appends to the file when needed but doesn't keep it open</description>
      <pubDate>Tue, 18 Dec 2001 14:54:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632349#M849913</guid>
      <dc:creator>Jeff Machols</dc:creator>
      <dc:date>2001-12-18T14:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632350#M849914</link>
      <description>In that case you could use tusc to find out what files the shell is opening.  Eg:&lt;BR /&gt;&lt;BR /&gt;# tusc -s 5 &lt;PID&gt;&lt;BR /&gt;&lt;BR /&gt;This will print out all the open system calls made by the process.  &lt;BR /&gt;&lt;BR /&gt;Another one of my personal favorites:&lt;BR /&gt;&lt;BR /&gt;# tusc -s 3 -d 0 &lt;PID&gt;&lt;BR /&gt;&lt;BR /&gt;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 :)&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Steve&lt;/PID&gt;&lt;/PID&gt;</description>
      <pubDate>Tue, 18 Dec 2001 15:08:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632350#M849914</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2001-12-18T15:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632351#M849915</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Three additional methods for tracing:&lt;BR /&gt;&lt;BR /&gt;1) Enable auditing of user via sam. You will need to convert your OS to trusted before auditing can be performed.&lt;BR /&gt;&lt;BR /&gt;2) Run account management via acctcom, runacct etc.&lt;BR /&gt;&lt;BR /&gt;3) Use expect scripting to log all screen output of a user's login shell (I have seen it done on one system).&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong&lt;BR /&gt;Brainbench MVP for Unix Admin&lt;BR /&gt;&lt;A href="http://www.brainbench.com" target="_blank"&gt;http://www.brainbench.com&lt;/A&gt;</description>
      <pubDate>Tue, 18 Dec 2001 15:15:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632351#M849915</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2001-12-18T15:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632352#M849916</link>
      <description>Steve,&lt;BR /&gt;&lt;BR /&gt;I like that command, That will help a lot&lt;BR /&gt;&lt;BR /&gt;THANKS</description>
      <pubDate>Tue, 18 Dec 2001 18:28:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632352#M849916</guid>
      <dc:creator>Jeff Machols</dc:creator>
      <dc:date>2001-12-18T18:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632353#M849917</link>
      <description>Steve,&lt;BR /&gt;&lt;BR /&gt;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?</description>
      <pubDate>Tue, 18 Dec 2001 19:28:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632353#M849917</guid>
      <dc:creator>Jeff Machols</dc:creator>
      <dc:date>2001-12-18T19:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632354#M849918</link>
      <description>Try sorting all the files in $HOME by timestamp:&lt;BR /&gt;&lt;BR /&gt;ll -t ~user_name&lt;BR /&gt;&lt;BR /&gt;The files at the top of the list were recently modified.  &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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".</description>
      <pubDate>Tue, 18 Dec 2001 20:01:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632354#M849918</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-12-18T20:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632355#M849919</link>
      <description>Bill,&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Tue, 18 Dec 2001 20:11:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632355#M849919</guid>
      <dc:creator>Jeff Machols</dc:creator>
      <dc:date>2001-12-18T20:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632356#M849920</link>
      <description>Jeff,&lt;BR /&gt;&lt;BR /&gt;You're right - it looks like it will display them only on an exec*() system call though.  Try running&lt;BR /&gt;&lt;BR /&gt;# tusc -f -p -e &lt;PID&gt;&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I guess that would mean the real answer to your question is to run:&lt;BR /&gt;&lt;BR /&gt;# tusc -f -p -e -s 59 &lt;PID&gt;&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Steve&lt;/PID&gt;&lt;/PID&gt;</description>
      <pubDate>Wed, 19 Dec 2001 09:15:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632356#M849920</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2001-12-19T09:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Looking at a shell ENV</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632357#M849921</link>
      <description>Thats exactly it Steve, now I have the proof I need to get rid of this %$*@er</description>
      <pubDate>Wed, 19 Dec 2001 13:47:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-at-a-shell-env/m-p/2632357#M849921</guid>
      <dc:creator>Jeff Machols</dc:creator>
      <dc:date>2001-12-19T13:47:19Z</dc:date>
    </item>
  </channel>
</rss>

