<?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: Script Command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074222#M308136</link>
    <description>Hey&lt;BR /&gt;&lt;BR /&gt;check the last and lastb command. this will show you the login and logout time of an user but not the execution time of a command.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
    <pubDate>Wed, 26 Sep 2007 08:26:09 GMT</pubDate>
    <dc:creator>Oviwan</dc:creator>
    <dc:date>2007-09-26T08:26:09Z</dc:date>
    <item>
      <title>Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074206#M308120</link>
      <description>I am using the script command to log whatever the user does after he logs in. I have put the command in his .profile. script -a /tmp/users/user.`date +%d%t` The problem is when he logs in he can see the message - Script started, file is /tmp/users/user.`date +%d%t` Since the script is being executed by his .profile, he can edit the log file &amp;amp; do all the changes. How do i deny the user from editing the script log file</description>
      <pubDate>Fri, 21 Sep 2007 10:00:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074206#M308120</guid>
      <dc:creator>jijujose</dc:creator>
      <dc:date>2007-09-21T10:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074207#M308121</link>
      <description>isn't there a -q option to surpress that message?</description>
      <pubDate>Fri, 21 Sep 2007 10:27:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074207#M308121</guid>
      <dc:creator>larsoncu</dc:creator>
      <dc:date>2007-09-21T10:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074208#M308122</link>
      <description>Where do i put that option -q&lt;BR /&gt;its giving&lt;BR /&gt;&lt;BR /&gt;script: illegal option -- q&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Sep 2007 10:33:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074208#M308122</guid>
      <dc:creator>jijujose</dc:creator>
      <dc:date>2007-09-21T10:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074209#M308123</link>
      <description>Maybe some experimentation is needed here.&lt;BR /&gt;&lt;BR /&gt;I would try to run it from an alias to see if the alias is echo'd instead of the script command. Maybe putting the script command at the top of the copyright/motd so it scrolls off the screen. If you just need the shell history maybe 'tee' would be better?&lt;BR /&gt;&lt;BR /&gt;You might also check the porting archive:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/" target="_blank"&gt;http://hpux.cs.utah.edu/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;to see if there is a better solution. I would caution you about the use of these type tools to invade users privacy. There should be a pretty good reason for doing something like this.</description>
      <pubDate>Fri, 21 Sep 2007 10:34:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074209#M308123</guid>
      <dc:creator>Glenn S. Davidson</dc:creator>
      <dc:date>2007-09-21T10:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074210#M308124</link>
      <description>ooops  &lt;BR /&gt;sorry there is no -q on hpux, there is on aix</description>
      <pubDate>Fri, 21 Sep 2007 10:35:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074210#M308124</guid>
      <dc:creator>larsoncu</dc:creator>
      <dc:date>2007-09-21T10:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074211#M308125</link>
      <description>Thanks Glenn, this is for auditing purposes.&lt;BR /&gt;The data is very sensitivie &amp;amp; there are many users who have access to the system.&lt;BR /&gt;I tried to change the permission of the dir to root &amp;amp; just give execute permission to the output file. That fails since it should have a write permission for logging activities. Is there any way I can hide the command from getting displayed on the screen wheneve the user logs in. The command is in his .profile so it will execute whenever the user logs in</description>
      <pubDate>Fri, 21 Sep 2007 11:23:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074211#M308125</guid>
      <dc:creator>jijujose</dc:creator>
      <dc:date>2007-09-21T11:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074212#M308126</link>
      <description>like glen suggested, put it in /etc/profile and not the user's .profile&lt;BR /&gt;&lt;BR /&gt;in profile do something like&lt;BR /&gt;if [[ $USER = user ]] ;then&lt;BR /&gt;script -a file&lt;BR /&gt;clear&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;copywrite&lt;BR /&gt;motd&lt;BR /&gt;etc&lt;BR /&gt;&lt;BR /&gt;you could also write to a pipe then create a process that only you can read from it.&lt;BR /&gt;&lt;BR /&gt;using a pipe they wouldn't be able to modify any of the information, but being they would have write permission to the pipe they could feed you bogus information to confuse you.</description>
      <pubDate>Fri, 21 Sep 2007 12:04:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074212#M308126</guid>
      <dc:creator>larsoncu</dc:creator>
      <dc:date>2007-09-21T12:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074213#M308127</link>
      <description>you could also put the script command between stty commands&lt;BR /&gt;&lt;BR /&gt;stty -echo #turn echoing to the screen off&lt;BR /&gt;script -a file&lt;BR /&gt;stty echo # turn echoing on</description>
      <pubDate>Fri, 21 Sep 2007 12:09:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074213#M308127</guid>
      <dc:creator>larsoncu</dc:creator>
      <dc:date>2007-09-21T12:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074214#M308128</link>
      <description>&amp;gt;larsoncu: you could also put the script command between stty commands&lt;BR /&gt;stty -echo&lt;BR /&gt;&lt;BR /&gt;This just turns off echoing of user input, not output in general.&lt;BR /&gt;&lt;BR /&gt;Also, when you use script, I think it won't read any other commands after it.</description>
      <pubDate>Sat, 22 Sep 2007 04:55:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074214#M308128</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-09-22T04:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074215#M308129</link>
      <description>larsconu&lt;BR /&gt; - also proposes to run a clear command after script -a&lt;BR /&gt;This will neither work, as the clear command won't be executed until the script is terminated (exit or Ctrl+D)&lt;BR /&gt;&lt;BR /&gt;I assume you would need an 'exit' immediately after the script command to ensure that the user simply not exit the script and continous the work in the original login shell&lt;BR /&gt;&lt;BR /&gt;If you want to audit 'what the users do' it might be an option to put a tail on their history file(s). This could run as a continous process from the root user and collect to some audit logfiles.&lt;BR /&gt;You will only get their commands - and not all the output (which might be unnecessary anyway).&lt;BR /&gt;&lt;BR /&gt;/Tor-Arne</description>
      <pubDate>Sat, 22 Sep 2007 05:32:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074215#M308129</guid>
      <dc:creator>Tor-Arne Nostdal</dc:creator>
      <dc:date>2007-09-22T05:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074216#M308130</link>
      <description>Thanks for all the information. Tor can you give me the tail comamand. I tired the tail -f &amp;amp; output to a different file in the .profile. I also used cat .sh_history &amp;gt; /tmp/users/usr.`date +%d%m` Its creating a file which i cant access. When i tried to vi or cat the file in /tmp/usrs/usr its says no such file.&lt;BR /&gt;I tried using stty -echo, script &amp;amp; stty echo but the command is still getting displayed on the screen&lt;BR /&gt;stty -echo&lt;BR /&gt;script -a /tmp/users/usr.`date +%d%m&lt;BR /&gt;stty echo&lt;BR /&gt;exit&lt;BR /&gt;logout&lt;BR /&gt;stty echo&lt;BR /&gt;clear&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Sep 2007 01:57:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074216#M308130</guid>
      <dc:creator>jijujose</dc:creator>
      <dc:date>2007-09-24T01:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074217#M308131</link>
      <description>&amp;gt;Tor can you give me the tail command. I tried the tail -f &amp;amp; output to a different file in the .profile. I also used cat .sh_history &amp;gt; /tmp/users/usr.`date +%d%m`&lt;BR /&gt;&lt;BR /&gt;The tail would just be:&lt;BR /&gt;$ tail -f ~/sh_history &amp;gt;&amp;gt; /tmp/users/usr.$(date +%d%m)&lt;BR /&gt;(And possibly something that includes the user's name?)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;It's creating a file which i cant access. &lt;BR /&gt;&lt;BR /&gt;Why not?  You're root.  Unless /tmp/users/ is on NFS you should be able to do anything to that file.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I tried using stty -echo, script &amp;amp; stty echo but the command is still getting displayed on the screen&lt;BR /&gt;&lt;BR /&gt;Of course, I mentioned why.</description>
      <pubDate>Mon, 24 Sep 2007 18:20:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074217#M308131</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-09-24T18:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074218#M308132</link>
      <description>Thanks Dennis, if i put the tail command in the .sh_history file, the output file will have the logs for only that sessions. The next day when the user logs in it wont have the logs. So i think its better to put it in cron. The cron worked fine. If there are multiple users (say around 50), how do i do it. Maybe a script would help. &lt;BR /&gt;</description>
      <pubDate>Tue, 25 Sep 2007 05:29:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074218#M308132</guid>
      <dc:creator>jijujose</dc:creator>
      <dc:date>2007-09-25T05:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074219#M308133</link>
      <description>&lt;!--!*#--&gt;&amp;gt;if i put the tail command in the .sh_history file, the output file will have the logs for only that sessions.&lt;BR /&gt;&lt;BR /&gt;I don't see why it wouldn't have all of the logs but the user could kill that tail.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;The next day when the user logs in it wont have the logs.&lt;BR /&gt;&lt;BR /&gt;You would have a different file for each day.  But you could append to a user specific file.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If there are multiple users (say around 50), how do i do it. Maybe a script would help.&lt;BR /&gt;&lt;BR /&gt;You would have to have a file of suspect users and just do:&lt;BR /&gt;for user in $(&amp;lt; suspect_users); do&lt;BR /&gt;   tail -f /home/$user/.sh_history &amp;gt;&amp;gt; tmp/users/$user &amp;amp;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This assumes the user doesn't change his history filename, HISTFILE.</description>
      <pubDate>Tue, 25 Sep 2007 05:47:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074219#M308133</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-09-25T05:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074220#M308134</link>
      <description>jijujose,&lt;BR /&gt;&lt;BR /&gt;if you have a proper planing for users home directory.&lt;BR /&gt;schedule this script in crontab as per your requirments.&lt;BR /&gt;&lt;BR /&gt;for user in `cat /etc/passwd|grep home|cut -d: -f1`&lt;BR /&gt;do&lt;BR /&gt;cat /home/$user/.sh_hostory &amp;gt;&amp;gt; /var/dir/$user.`date +%d%m` &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Cheers.</description>
      <pubDate>Tue, 25 Sep 2007 06:05:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074220#M308134</guid>
      <dc:creator>AwadheshPandey</dc:creator>
      <dc:date>2007-09-25T06:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074221#M308135</link>
      <description>Thanks Gentlemen, your inputs have been very useful. I am able to get the log files...is there any way the log file can also have the date &amp;amp; time of the commands the user had entered after he logged in.</description>
      <pubDate>Wed, 26 Sep 2007 08:09:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074221#M308135</guid>
      <dc:creator>jijujose</dc:creator>
      <dc:date>2007-09-26T08:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Script Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074222#M308136</link>
      <description>Hey&lt;BR /&gt;&lt;BR /&gt;check the last and lastb command. this will show you the login and logout time of an user but not the execution time of a command.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 26 Sep 2007 08:26:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command/m-p/4074222#M308136</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2007-09-26T08:26:09Z</dc:date>
    </item>
  </channel>
</rss>

