<?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: Audit root in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344533#M746830</link>
    <description>If you want to audit shell commands which is executed by root or anyother users, then settings are needed in /etc/profile file.&lt;BR /&gt;&lt;BR /&gt; Make a history file and size with HISTFILE and HISTSIZE options.&lt;BR /&gt;&lt;BR /&gt; Use HISTFILE as meanful to identify the users and their logins. Use this settings after the export of $HOME variable to that user.&lt;BR /&gt;&lt;BR /&gt; HISTFILE=$HOME/.sh_history_$(id -un).$$&lt;BR /&gt; export $HISTFILE&lt;BR /&gt; HISTSIZE=1000&lt;BR /&gt; export $HISTSIZE&lt;BR /&gt; echo who &amp;gt;&amp;gt; $HISTFILE&lt;BR /&gt;&lt;BR /&gt; You can identify number of logins which made by the user on that day with that PID informations. More history files will be created with PID's. &lt;BR /&gt;&lt;BR /&gt; find / -name ".sh_history_*" -exec ls {} \; | cut -d "." -f 1 | awk '{ print "mv "$1".* "$1 }' | sh&lt;BR /&gt;&lt;BR /&gt; It will redirect all history of user's to $HOME/.sh_history file &lt;BR /&gt;</description>
    <pubDate>Thu, 29 Jul 2004 12:43:08 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2004-07-29T12:43:08Z</dc:date>
    <item>
      <title>Audit root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344529#M746826</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need to audit the access and commands executed from root user, how can I do this ?&lt;BR /&gt;And if I need to audit another users ??&lt;BR /&gt;&lt;BR /&gt;I have hp-ux 11.0&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Thu, 29 Jul 2004 08:44:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344529#M746826</guid>
      <dc:creator>Daniel Ubeda</dc:creator>
      <dc:date>2004-07-29T08:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Audit root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344530#M746827</link>
      <description>Put the following code in root's .profile.&lt;BR /&gt;&lt;BR /&gt;export HISTFILE=/root/.sh_history.$$&lt;BR /&gt;LOGINID=`who am i 2&amp;gt;/dev/null |cut -f1 -d" "`&lt;BR /&gt;if [ "$LOGINID" != "" ]&lt;BR /&gt;then&lt;BR /&gt;who -m -u &amp;gt;/var/adm/security/rootlogs/login.$$&lt;BR /&gt;fi&lt;BR /&gt;unset LOGINID&lt;BR /&gt;&lt;BR /&gt;This will create the history file as .sh_history.xxxx.&lt;BR /&gt;xxxx-is the shell pid.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Thu, 29 Jul 2004 09:03:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344530#M746827</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-07-29T09:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Audit root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344531#M746828</link>
      <description>I use the following in the root .profile (we don't allow direct root login to the servers, so users have to use su);&lt;BR /&gt;&lt;BR /&gt;export I_AM=`who -m | awk '{print $1}'`&lt;BR /&gt;export LOGIN_DATE=`date +%d%m%y`&lt;BR /&gt;export HISTFILE=/var/tmp/history/.sh_history.$I_AM.$LOGIN_DATE&lt;BR /&gt;&lt;BR /&gt;This gives me a list of root commands in history files for any user on a given date&lt;BR /&gt;&lt;BR /&gt;eg:  if I was to use my test ID to switch to root today, I'd end up with a file&lt;BR /&gt;&lt;BR /&gt;/var/tmp/history/.sh_history.cwtest.290704</description>
      <pubDate>Thu, 29 Jul 2004 09:08:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344531#M746828</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2004-07-29T09:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Audit root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344532#M746829</link>
      <description>We do this in root's .profile:&lt;BR /&gt;&lt;BR /&gt;# Set up logging&lt;BR /&gt;HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`&lt;BR /&gt;date &amp;gt;&amp;gt;$HISTFILE&lt;BR /&gt;export HISTFILE&lt;BR /&gt;HISTSIZE=500&lt;BR /&gt;export HISTSIZE&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Thu, 29 Jul 2004 10:01:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344532#M746829</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-07-29T10:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Audit root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344533#M746830</link>
      <description>If you want to audit shell commands which is executed by root or anyother users, then settings are needed in /etc/profile file.&lt;BR /&gt;&lt;BR /&gt; Make a history file and size with HISTFILE and HISTSIZE options.&lt;BR /&gt;&lt;BR /&gt; Use HISTFILE as meanful to identify the users and their logins. Use this settings after the export of $HOME variable to that user.&lt;BR /&gt;&lt;BR /&gt; HISTFILE=$HOME/.sh_history_$(id -un).$$&lt;BR /&gt; export $HISTFILE&lt;BR /&gt; HISTSIZE=1000&lt;BR /&gt; export $HISTSIZE&lt;BR /&gt; echo who &amp;gt;&amp;gt; $HISTFILE&lt;BR /&gt;&lt;BR /&gt; You can identify number of logins which made by the user on that day with that PID informations. More history files will be created with PID's. &lt;BR /&gt;&lt;BR /&gt; find / -name ".sh_history_*" -exec ls {} \; | cut -d "." -f 1 | awk '{ print "mv "$1".* "$1 }' | sh&lt;BR /&gt;&lt;BR /&gt; It will redirect all history of user's to $HOME/.sh_history file &lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jul 2004 12:43:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344533#M746830</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-07-29T12:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Audit root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344534#M746831</link>
      <description>A comment on responses so far: we also have history set up in root's .profile, - but if the user does "su root" ( leaving out the "-" ) root's .profile is not executed, and so history doesn't get saved. I'm considering moving the history setup to /etc/profile to fix that issue.</description>
      <pubDate>Thu, 29 Jul 2004 13:09:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344534#M746831</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2004-07-29T13:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Audit root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344535#M746832</link>
      <description>another tip is that if two users become root, in the history file the rows are writen not in sequential way, then, I will not follow the command for analisys ...&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Aug 2004 07:30:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/audit-root/m-p/3344535#M746832</guid>
      <dc:creator>Daniel Ubeda</dc:creator>
      <dc:date>2004-08-02T07:30:00Z</dc:date>
    </item>
  </channel>
</rss>

