<?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: limt user function in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945743#M412609</link>
    <description>Have their login shell call the script that you want to run.&lt;BR /&gt;&lt;BR /&gt;At the beginning of the script do a:&lt;BR /&gt;&lt;BR /&gt;trap "" 1 2 3&lt;BR /&gt;&lt;BR /&gt;At the end of the script do an:&lt;BR /&gt;&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;So your script looks like:&lt;BR /&gt;&lt;BR /&gt;# cat /dir/scriptname&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;trap "" 1 2 3&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;do your stuff here&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;The linke in the passwd file would be:&lt;BR /&gt;&lt;BR /&gt;users:*:9999:99:GECOS STUFF:/user/homedir:/dir/scriptname&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 08 Dec 2005 15:30:08 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2005-12-08T15:30:08Z</dc:date>
    <item>
      <title>limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945742#M412608</link>
      <description>I am trying to setup a user so that after they login a script begins automatically.  Once this script is done I want to automatically log this user off.  I do not want them to be able to breakout of the script while it is running to get to a command prompt. &lt;BR /&gt;&lt;BR /&gt;Any Ideas?&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Dec 2005 15:23:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945742#M412608</guid>
      <dc:creator>Michael Allmer</dc:creator>
      <dc:date>2005-12-08T15:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945743#M412609</link>
      <description>Have their login shell call the script that you want to run.&lt;BR /&gt;&lt;BR /&gt;At the beginning of the script do a:&lt;BR /&gt;&lt;BR /&gt;trap "" 1 2 3&lt;BR /&gt;&lt;BR /&gt;At the end of the script do an:&lt;BR /&gt;&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;So your script looks like:&lt;BR /&gt;&lt;BR /&gt;# cat /dir/scriptname&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;trap "" 1 2 3&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;do your stuff here&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;The linke in the passwd file would be:&lt;BR /&gt;&lt;BR /&gt;users:*:9999:99:GECOS STUFF:/user/homedir:/dir/scriptname&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Dec 2005 15:30:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945743#M412609</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-12-08T15:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945744#M412610</link>
      <description>Hi Mike ,&lt;BR /&gt;&lt;BR /&gt;Use exit  in the end of the script. This will make the user logged off after the script is finished.  &lt;BR /&gt;&lt;BR /&gt;Also change the interrupt character like Ctrl+c  to something else ,so it willnot break the script. ex : stty intr ^u  or something like that ,&lt;BR /&gt;&lt;BR /&gt;Hope this will help ,&lt;BR /&gt;&lt;BR /&gt;cheers,&lt;BR /&gt;Raj.</description>
      <pubDate>Thu, 08 Dec 2005 15:31:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945744#M412610</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2005-12-08T15:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945745#M412611</link>
      <description>Here is what I have set up:&lt;BR /&gt;In /etc/passwd&lt;BR /&gt;sms:***:111:113:SMS inventory,,,:/home/sms:/home/sms/sh_sm&lt;BR /&gt;&lt;BR /&gt;In sh_sms:&lt;BR /&gt;#cat /home/sms/gatherer.s&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;trap "" 123&lt;BR /&gt;&lt;BR /&gt;/home/sms/gatherer.sh&lt;BR /&gt;&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Once the sms user logged on the script did not run and was at the command prompt.</description>
      <pubDate>Thu, 08 Dec 2005 15:56:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945745#M412611</guid>
      <dc:creator>Michael Allmer</dc:creator>
      <dc:date>2005-12-08T15:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945746#M412612</link>
      <description>Is the script executable?  Did you get any errors?  &lt;BR /&gt;&lt;BR /&gt;What you have should work provided permissions are correct.</description>
      <pubDate>Thu, 08 Dec 2005 16:02:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945746#M412612</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-12-08T16:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945747#M412613</link>
      <description>Hi Mike:&lt;BR /&gt;&lt;BR /&gt;You show the entry in '/etc/passwd' as:&lt;BR /&gt;&lt;BR /&gt;/home/sms/sh_sm&lt;BR /&gt;&lt;BR /&gt;Yet you list the script as if the name is:&lt;BR /&gt;&lt;BR /&gt;/home/sms/sh_sms&lt;BR /&gt;&lt;BR /&gt;...with a trailing "s".&lt;BR /&gt;&lt;BR /&gt;Is that a posting error?&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 08 Dec 2005 16:04:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945747#M412613</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-08T16:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945748#M412614</link>
      <description>I set the permisions to&lt;BR /&gt;-rwxr-r-xr-x   sms  readonly  sh_sms&lt;BR /&gt;-rwxr-xr-x     sms  readonly gatherer.sh&lt;BR /&gt;&lt;BR /&gt;Then I got a error about the trap syntax.&lt;BR /&gt;&lt;BR /&gt;Adjusted the syntax to trap " " 1 2 3 &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;All is working.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Dec 2005 16:11:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945748#M412614</guid>
      <dc:creator>Michael Allmer</dc:creator>
      <dc:date>2005-12-08T16:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945749#M412615</link>
      <description>JRF&lt;BR /&gt;&lt;BR /&gt;The s was left off when I copied the items over from the term window.&lt;BR /&gt;&lt;BR /&gt;Thank you,</description>
      <pubDate>Thu, 08 Dec 2005 16:15:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945749#M412615</guid>
      <dc:creator>Michael Allmer</dc:creator>
      <dc:date>2005-12-08T16:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945750#M412616</link>
      <description>Glad its working for you.  If you want it to be  a bit more secure, I would drop the "world/other" permissions from those files.  Make them rwxr-x--- (750 or o-rx for the chmod command).  There's probably no reason for them to be world-readable/executable.</description>
      <pubDate>Thu, 08 Dec 2005 16:22:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945750#M412616</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-12-08T16:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: limt user function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945751#M412617</link>
      <description>Thank you to all.&lt;BR /&gt;&lt;BR /&gt;Thank you Patrick about setting the correct secuirty, it gave me the sytax error at that point and all is well.</description>
      <pubDate>Thu, 08 Dec 2005 16:25:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/limt-user-function/m-p/4945751#M412617</guid>
      <dc:creator>Michael Allmer</dc:creator>
      <dc:date>2005-12-08T16:25:12Z</dc:date>
    </item>
  </channel>
</rss>

