<?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: login shell in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263913#M674445</link>
    <description>One very important feature that your menu script (as well as 8every* shell script) must have is line #1 with the interpreter listed. If you write the script in ksh, then line 1 must be:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt; &lt;BR /&gt;Or if you use the POSIX shell: #!/usr/bin/sh&lt;BR /&gt; &lt;BR /&gt;And of course the script must be executable by all the users, typically 755 (never 777) permissions.&lt;BR /&gt; &lt;BR /&gt;What will happen at login is that the menu script will be run and any attempt to exit the script returns to another login request. Make sure your script does not provide a menu item for vi or other program that allows the user to call a shell (using the ! character). Just to be sure, you can set the SHELL variable in your script:&lt;BR /&gt; &lt;BR /&gt;export SHELL=/usr/bin/false</description>
    <pubDate>Fri, 05 Sep 2008 22:12:06 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2008-09-05T22:12:06Z</dc:date>
    <item>
      <title>login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263903#M674435</link>
      <description>Friend,&lt;BR /&gt;&lt;BR /&gt;I am writing trying to write a shell script that will given a user menu options. The issue is that when I put exit the user comes back to the shell promt. I need that when he uses the exit option he should be completely logged off from the system.&lt;BR /&gt;&lt;BR /&gt;Kindly advice on what how the account should be created or a sample script will be greatly appreciated.</description>
      <pubDate>Fri, 05 Sep 2008 15:35:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263903#M674435</guid>
      <dc:creator>Kwhite_1</dc:creator>
      <dc:date>2008-09-05T15:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263904#M674436</link>
      <description>Two options.&lt;BR /&gt;&lt;BR /&gt;1)  use the script as the shell in /etc/passwd&lt;BR /&gt;&lt;BR /&gt;2) in the profile start the script with exec /scriptname&lt;BR /&gt;&lt;BR /&gt;(if you use the profile option and the user has ftp access then they can simply replace the profile to circumvent the existing one.)&lt;BR /&gt;&lt;BR /&gt;The shell in the password file is more secure.&lt;BR /&gt;&lt;BR /&gt;(script must start with #!/usr/bin/ksh (or sh).&lt;BR /&gt;&lt;BR /&gt;Do not forget to set the traps as well ( trap 1 2 3 ...)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Sep 2008 15:38:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263904#M674436</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2008-09-05T15:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263905#M674437</link>
      <description>I'm just throwing out this question because I don't know the answer and if the answer is yes, it is pertinent to this question:&lt;BR /&gt;&lt;BR /&gt;Does the script need to be listed in /etc/shells if you're going to put it in the password file?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 05 Sep 2008 15:46:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263905#M674437</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2008-09-05T15:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263906#M674438</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Pete: Does the script need to be listed in /etc/shells if you're going to put it in the password file?&lt;BR /&gt;&lt;BR /&gt;No, it doesn't.&lt;BR /&gt;&lt;BR /&gt;Substituting the menu-based script for the normal login shell prevents smart users who might have a 'more' pipeline in the menu from shelling-out with a bang (!) into a real shell, circumventing the menu.  Hence, of the techniques Tim mentioned, this is my preference.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 05 Sep 2008 15:52:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263906#M674438</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-05T15:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263907#M674439</link>
      <description>I am not getting this how should the account look like</description>
      <pubDate>Fri, 05 Sep 2008 16:04:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263907#M674439</guid>
      <dc:creator>Kwhite_1</dc:creator>
      <dc:date>2008-09-05T16:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263908#M674440</link>
      <description>/etc/shell entry  &amp;gt;&amp;gt;  Only if you want FTP to work.&lt;BR /&gt;&lt;BR /&gt;/etc/passwd entry.&lt;BR /&gt;&lt;BR /&gt;user1:*:1000:200::/home/user1:/user/local/bin/menu.ksh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Sep 2008 16:10:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263908#M674440</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2008-09-05T16:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263909#M674441</link>
      <description>oops.. typo&lt;BR /&gt;change &lt;BR /&gt;user1:*:1000:200::/home/user1:/user/local/bin/menu.ksh&lt;BR /&gt;&lt;BR /&gt;to&lt;BR /&gt;user1:*:1000:200::/home/user1:/usr/local/bin/menu.ksh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;you get the idea.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Sep 2008 16:11:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263909#M674441</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2008-09-05T16:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263910#M674442</link>
      <description>&amp;gt; how should the account look like&lt;BR /&gt;&lt;BR /&gt;In /etc/passwd?  Something like this:&lt;BR /&gt;&lt;BR /&gt;user_nam:encrypted_password:101:101::/home/user_name:full_path_name_of_script&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 05 Sep 2008 16:11:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263910#M674442</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2008-09-05T16:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263911#M674443</link>
      <description>Got it thanks all</description>
      <pubDate>Fri, 05 Sep 2008 16:16:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263911#M674443</guid>
      <dc:creator>Kwhite_1</dc:creator>
      <dc:date>2008-09-05T16:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263912#M674444</link>
      <description>&amp;gt;Pete: Does the script need to be listed in /etc/shells if you're going to put it in the password file?&lt;BR /&gt;&lt;BR /&gt;As JRF said, no.  login doesn't look at shells(4), only ftp and a few others.</description>
      <pubDate>Fri, 05 Sep 2008 17:19:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263912#M674444</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-09-05T17:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: login shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263913#M674445</link>
      <description>One very important feature that your menu script (as well as 8every* shell script) must have is line #1 with the interpreter listed. If you write the script in ksh, then line 1 must be:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt; &lt;BR /&gt;Or if you use the POSIX shell: #!/usr/bin/sh&lt;BR /&gt; &lt;BR /&gt;And of course the script must be executable by all the users, typically 755 (never 777) permissions.&lt;BR /&gt; &lt;BR /&gt;What will happen at login is that the menu script will be run and any attempt to exit the script returns to another login request. Make sure your script does not provide a menu item for vi or other program that allows the user to call a shell (using the ! character). Just to be sure, you can set the SHELL variable in your script:&lt;BR /&gt; &lt;BR /&gt;export SHELL=/usr/bin/false</description>
      <pubDate>Fri, 05 Sep 2008 22:12:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/login-shell/m-p/4263913#M674445</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-09-05T22:12:06Z</dc:date>
    </item>
  </channel>
</rss>

