<?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: Clear .sh_history when log off in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183245#M460337</link>
    <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; SEP: The reason stuff is kept in these files is so there is a record of what was done when. &lt;BR /&gt;This is a basic security measure and helps you catch your own mistakes. Doing what you propose probably violates security audit parameters and is not a good idea.&lt;BR /&gt;&lt;BR /&gt;I'm sorry to disagree, but I do!  This is _no_ audit if you consider that the owner of the history file has every right to truncate the file before he/she logs off.  In fact, I routinely do this when I have issued a 'shutdown' command as root.  I don't want to be able to inadvertently recall the command history looking for a command that lay next to the 'shutdown' and stupidly re-trigger that shutdown again by mistake!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
    <pubDate>Tue, 23 Jun 2009 21:36:07 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-06-23T21:36:07Z</dc:date>
    <item>
      <title>Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183239#M460331</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I would like to exec a script when i log off putty, telnet, xterm session to clear out .sh_history.&lt;BR /&gt;Please tell me where can i put this script.&lt;BR /&gt;Regards,&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Jun 2009 15:16:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183239#M460331</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2009-06-23T15:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183240#M460332</link>
      <description>trap "cat /dev/null &amp;gt;.sh_history" 0 1 3 15&lt;BR /&gt;&lt;BR /&gt;place this in users' .profile or if you want this for everybody, place it in /etc/profile &lt;BR /&gt;&lt;BR /&gt;hope this helps</description>
      <pubDate>Tue, 23 Jun 2009 15:26:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183240#M460332</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-06-23T15:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183241#M460333</link>
      <description>Do you have a separate history file for each session, if multiple logins?&lt;BR /&gt;Mel's solution may blast it for each script you run?</description>
      <pubDate>Tue, 23 Jun 2009 15:28:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183241#M460333</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-23T15:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183242#M460334</link>
      <description>Thank you Mel &amp;amp; Dennis for your helps.&lt;BR /&gt;&lt;BR /&gt;i only have one .sh_history&lt;BR /&gt;Mel- this line works when i add it to the bottom of the .profile&lt;BR /&gt;Question:&lt;BR /&gt;Can i hide this line from .profile&lt;BR /&gt;when i move this line up within .profile it does not seem to work.&lt;BR /&gt;Reason: do not want user to see it.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Jun 2009 16:58:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183242#M460334</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2009-06-23T16:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183243#M460335</link>
      <description>Hi Tom:&lt;BR /&gt;&lt;BR /&gt;Did you do this in the ${HOME}/.profile or in '/etc/profile'?&lt;BR /&gt;&lt;BR /&gt;If you did this in '/etc/profile' you need to put it at the end since there is (by default) a 'trap' for the signals in question already there.  This would override Mel's suggestion if you don't put his last.&lt;BR /&gt;&lt;BR /&gt;Security by obsurity is weak.  Any user can list ('cat', etc.) '/etc/profile' to see what you have done.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 23 Jun 2009 17:19:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183243#M460335</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-23T17:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183244#M460336</link>
      <description>Shalom Tom,&lt;BR /&gt;&lt;BR /&gt;The reason stuff is kept in these files is so there is a record of what was done when.&lt;BR /&gt;&lt;BR /&gt;This is a basic security measure and helps you catch your own mistakes.&lt;BR /&gt;&lt;BR /&gt;Doing what you propose probably violates security audit parameters and is not a good idea.&lt;BR /&gt;&lt;BR /&gt;Modify the ideas above to at least archive this information so its available when you need it.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 23 Jun 2009 18:04:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183244#M460336</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-06-23T18:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183245#M460337</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; SEP: The reason stuff is kept in these files is so there is a record of what was done when. &lt;BR /&gt;This is a basic security measure and helps you catch your own mistakes. Doing what you propose probably violates security audit parameters and is not a good idea.&lt;BR /&gt;&lt;BR /&gt;I'm sorry to disagree, but I do!  This is _no_ audit if you consider that the owner of the history file has every right to truncate the file before he/she logs off.  In fact, I routinely do this when I have issued a 'shutdown' command as root.  I don't want to be able to inadvertently recall the command history looking for a command that lay next to the 'shutdown' and stupidly re-trigger that shutdown again by mistake!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Jun 2009 21:36:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183245#M460337</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-23T21:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183246#M460338</link>
      <description>I have to agree with JRF on this one. As the .sh_history needs to be user writable, there is no way to trust that data for any audit purpose. If you make it unwritable, then you lose the benefit of having a shell history.&lt;BR /&gt;&lt;BR /&gt;If the purpose is auditing users in the sense of what they have done, then an external solution needs to be involved, like power broker, where you can log every key stroke of the user onto an external server, unreachable by the end user. Then it is a valid auditable log.</description>
      <pubDate>Wed, 24 Jun 2009 00:13:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183246#M460338</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-06-24T00:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183247#M460339</link>
      <description>&lt;!--!*#--&gt;If you don't want to save your history, don't define HISTFILE, or unset it.&lt;BR /&gt;As long as you aren't root (or you use ksh), you still will have a history.&lt;BR /&gt;&lt;BR /&gt;In regards to Mel's solution, that will blast it for every shell script you run.&lt;BR /&gt;&lt;BR /&gt;You would need to do:&lt;BR /&gt;shell=$(UNIX95=EXTENDED_PS ps -p $$ -ocomm=)&lt;BR /&gt;if [[ "$shell" = -* ]]; then&lt;BR /&gt;   echo "Login shell: $shell"&lt;BR /&gt;   &amp;gt; $HISTFILE&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Or using it in a trap command:&lt;BR /&gt; trap 'shell=$(UNIX95=EXTENDED_PS ps -p $$ -ocomm=)&lt;BR /&gt;if [[ "$shell" = -* ]]; then&lt;BR /&gt;   #echo "Login shell: $shell"&lt;BR /&gt;   &amp;gt; $HISTFILE&lt;BR /&gt;fi' 0 1 3 15</description>
      <pubDate>Wed, 24 Jun 2009 00:54:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183247#M460339</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-24T00:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Clear .sh_history when log off</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183248#M460340</link>
      <description>Thank you all for your info.&lt;BR /&gt;Regards,&lt;BR /&gt;Tom</description>
      <pubDate>Wed, 24 Jun 2009 15:29:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-sh-history-when-log-off/m-p/5183248#M460340</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2009-06-24T15:29:50Z</dc:date>
    </item>
  </channel>
</rss>

