<?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 Security - Root Account Shell History in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110989#M148802</link>
    <description>How can we add date/time stamp information automatically to the shell history?</description>
    <pubDate>Wed, 05 Nov 2003 08:43:15 GMT</pubDate>
    <dc:creator>Henry Weldon</dc:creator>
    <dc:date>2003-11-05T08:43:15Z</dc:date>
    <item>
      <title>Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110989#M148802</link>
      <description>How can we add date/time stamp information automatically to the shell history?</description>
      <pubDate>Wed, 05 Nov 2003 08:43:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110989#M148802</guid>
      <dc:creator>Henry Weldon</dc:creator>
      <dc:date>2003-11-05T08:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110990#M148803</link>
      <description>Henry,&lt;BR /&gt;&lt;BR /&gt;No way that I know of.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Nov 2003 08:48:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110990#M148803</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-11-05T08:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110991#M148804</link>
      <description>Hi,&lt;BR /&gt;I do not think it is possible for the obvious reason that it would make the file useless for its original purpose, e.g. recalling a prevous command.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Wed, 05 Nov 2003 08:51:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110991#M148804</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-11-05T08:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110992#M148805</link>
      <description>I don't think you can, the shell writes this history log, and I don't know of a way to tell it to time stamp the entries. There's a problem with this approach too: Anyone with root access can expurgate the file. So if you are trying to track commands, and someone doesn't want you to know, they can remove the entries.&lt;BR /&gt;&lt;BR /&gt;A better way to do this, might be to convert to a trusted system and then enabling accounting for the root account. Then the system will then track every single command run by root and log it in a binary file format. Someone who knows what they are doing can edit this file too, but it requires specialzed commands to do so.&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Wed, 05 Nov 2003 08:51:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110992#M148805</guid>
      <dc:creator>Brian Bergstrand</dc:creator>
      <dc:date>2003-11-05T08:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110993#M148806</link>
      <description>Hi Henry,&lt;BR /&gt;&lt;BR /&gt;Nope, sorry there's no easy way to do this.&lt;BR /&gt;The history file is a binary file, but not just a run-of-the-mill binary file &amp;amp; this is deliberate so that any tampering will make the file unreadable. This is so one cannot cover their tracks without leaving a big clue.&lt;BR /&gt;&lt;BR /&gt;One thing I could think of doing is every so often issue the following command&lt;BR /&gt;date | logger #110503080345&lt;BR /&gt;which history would dutifully store &amp;amp; the syslog.log would contain the date entry from the issuing user. You can use the syslog.log to verify the history entry.&lt;BR /&gt;&lt;BR /&gt;My 2 cents,&lt;BR /&gt;Jeff</description>
      <pubDate>Wed, 05 Nov 2003 09:05:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110993#M148806</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-11-05T09:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110994#M148807</link>
      <description>Jeff,&lt;BR /&gt;&lt;BR /&gt;I just checked my .sh_history file, and it is plain text. (11.00) Are you sure your not thinking of the binary accounting files?&lt;BR /&gt;&lt;BR /&gt;Also, with root access, syslog is not tamper safe either. Nothing is. Good idea about the logger though. You could also execute `date &amp;gt;&amp;gt; $HOME/.sh_history' every few minutes from cron. Doesn't fix the tampering problem though.</description>
      <pubDate>Wed, 05 Nov 2003 09:11:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110994#M148807</guid>
      <dc:creator>Brian Bergstrand</dc:creator>
      <dc:date>2003-11-05T09:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110995#M148808</link>
      <description>This is a terrible hack but you could have a little script that get run by .profile, loops reading from the history file and writes out each line as it gets it with a time stamp to a completely different file.  &lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Wed, 05 Nov 2003 09:16:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110995#M148808</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-11-05T09:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110996#M148809</link>
      <description>You need a tool like upm (unix privilege manager).&lt;BR /&gt;&lt;A href="http://www.passgo.com/datasheets/upm.pdf" target="_blank"&gt;http://www.passgo.com/datasheets/upm.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-- Graham&lt;BR /&gt;&lt;BR /&gt;BTW - .sh_history may not be a true binary file, but it's no ordinary text file - mine starts with 2 control-As.</description>
      <pubDate>Wed, 05 Nov 2003 09:22:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110996#M148809</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-11-05T09:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110997#M148810</link>
      <description>Hi Brian,&lt;BR /&gt;&lt;BR /&gt;It's true that the file command will report the .sh_history file as ascii text.&lt;BR /&gt;But more it out &amp;amp; look at it. It will contain control chars placed at seemingly random intervals. But there is a method to this madness &amp;amp; this is what the shell uses to determine whether the file has been altered. Any editing of this file upsets this sequence &amp;amp; renders the file useless.&lt;BR /&gt;Try it if you don't believe me.&lt;BR /&gt; &lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Wed, 05 Nov 2003 09:31:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110997#M148810</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-11-05T09:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110998#M148811</link>
      <description>Don't know if this helps, but everytime we su to root, we date stamp a "personal" history file.  Basically, every sysadmin who su's to root has there own root history file.&lt;BR /&gt;&lt;BR /&gt;For example, mine is .sh_history_gwild&lt;BR /&gt;&lt;BR /&gt;In root's .profile, add:&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;If you wanted to do it for every single command run as root - then you would have to write some sort of "wrapper" script for every command to be run as root - ouch....&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 05 Nov 2003 09:32:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110998#M148811</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2003-11-05T09:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110999#M148812</link>
      <description>Hi,&lt;BR /&gt; &lt;BR /&gt;for admin accounts (root, dba, ...) we have a history file per user per terminal.  This prevents you from retrieving someone elses previous commands (not really for security reasons, but more for safety : you don't want to execute someone elses command again by accident, specially not rm statements).&lt;BR /&gt; &lt;BR /&gt;HISTFILE=$HOME/.sh_history_`basename $TTY`&lt;BR /&gt; &lt;BR /&gt;This trick allows you also to put some extra info in the history file when they login : "who am i", "date"  to get real user name and login time.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;Thierry.&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Nov 2003 09:36:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3110999#M148812</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2003-11-05T09:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Security - Root Account Shell History</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3111000#M148813</link>
      <description>Jeff,&lt;BR /&gt;&lt;BR /&gt;I noticed the control chars at the top, but didn't notice the rest. Anyway, just for s**ts and giggles I tried replacing a command in the history file with random characters ammounting to the same # as the original command. It worked. My history file was still valid, and fc still let me use it. So these control chars may protect against outright removal of a command, but not against replacement. I suspect it's not a tamper system, but more of an indexing one.</description>
      <pubDate>Wed, 05 Nov 2003 10:11:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/security-root-account-shell-history/m-p/3111000#M148813</guid>
      <dc:creator>Brian Bergstrand</dc:creator>
      <dc:date>2003-11-05T10:11:31Z</dc:date>
    </item>
  </channel>
</rss>

