<?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: Restricted logins in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454490#M759822</link>
    <description>Hi,&lt;BR /&gt;You could use a restricted shell for the user logins and allow only " su - "&lt;BR /&gt;This will ensure the users are always doing su -  instaed of su. Hope this helps.&lt;BR /&gt;</description>
    <pubDate>Mon, 23 Oct 2000 09:02:34 GMT</pubDate>
    <dc:creator>Vinit Adya</dc:creator>
    <dc:date>2000-10-23T09:02:34Z</dc:date>
    <item>
      <title>Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454481#M759813</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;APOLOGY&gt; Long posting ahead &lt;/APOLOGY&gt;&lt;BR /&gt;&lt;BR /&gt;I've been working on writing a script to restrict logins on specified accounts.  I have a script which checks to see if an account is restricted and if so, only users belonging to a particular group can log into that account.  Further, the user MUST su to the account, no direct logins are allowed.  I know I can accomplish this with /etc/securetty for root, but I have other users that I want to restrict, such as oracle and several application users.&lt;BR /&gt;&lt;BR /&gt;To demostrate, in order to log into the oracle account, the user must log into a regular user account and then su to oracle.  When su-ing, my script checks to see if the user is in the su-oracle group, then it checks that the parent process is a valid shell (thus proving that the account is being su-ed into and not a direct login).  If both of these conditions are met, the script allows the user to log in as oracle.&lt;BR /&gt;&lt;BR /&gt;The script is run from /etc/profile, so there is no way to get around running it.  However, I've come across a few limitations with my script.&lt;BR /&gt;&lt;BR /&gt;1.  The user has to su - otherwise the /etc/profile is not run and therefore my script is not run thus defeating my security measures.&lt;BR /&gt;&lt;BR /&gt;2. Because of the way the script works, it does not allow su-ing from other scripts.&lt;BR /&gt;&lt;BR /&gt;Does anyone know a way around this?&lt;BR /&gt;&lt;BR /&gt;I'm willing to post the script if anyone is interested.&lt;BR /&gt;&lt;BR /&gt;-Santosh Nair (snair@graffiti.net)</description>
      <pubDate>Tue, 17 Oct 2000 11:55:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454481#M759813</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2000-10-17T11:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454482#M759814</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Some initial thoughts...&lt;BR /&gt;&lt;BR /&gt;You can stop regular login and enforce the use of su by setting the encrypted password in /etc/passwd to *.&lt;BR /&gt;&lt;BR /&gt;You can differentiate between login and su in your .profile by the setting of ${0}. For su this will be set to '-su' and for login '-sh'.&lt;BR /&gt;&lt;BR /&gt;You could also investigate checking whether or not there is a terminal associated with the process 'if [[ -t 0 ]];' so that if there isn't then you don't restrict. This may fix your script calling su problem.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Tue, 17 Oct 2000 12:10:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454482#M759814</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2000-10-17T12:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454483#M759815</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;I'm afraid I don't understand.  If you set the passwd to '*', then no one can log into that account (other than root).  That was not my intent.  I wanted users to be able to log in if they are authorized (i.e. in a particular group).&lt;BR /&gt;&lt;BR /&gt;As for $0, that only works if the shell specified in /etc/passwd is /usr/bin/sh.  Otherwise $0 is set to -shellname or shellname depending on whether the user su-ed with the '-' option or not.&lt;BR /&gt;&lt;BR /&gt;Finally, as the tty, since this script is run after the user has logged in (since its being run from /etc/profile), there is always a tty assigned.  So this doesn't really help.&lt;BR /&gt;&lt;BR /&gt;Thanks for the input though.</description>
      <pubDate>Tue, 17 Oct 2000 15:33:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454483#M759815</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2000-10-17T15:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454484#M759816</link>
      <description>In the $HOME/.profiles, you could have the grget command executed and depending on the result, test to see if the user is part of the group. &lt;BR /&gt;&lt;BR /&gt;If a member of group DBA, then OK, they can login and enter data (or whatever). If not a member, then echo back a comment and exit out or something to that effect.&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Oct 2000 15:38:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454484#M759816</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2000-10-17T15:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454485#M759817</link>
      <description>Rick,&lt;BR /&gt;&lt;BR /&gt;That is essentially what I am doing and that part works just fine.  The problem that I'm &lt;BR /&gt;having is:&lt;BR /&gt;&lt;BR /&gt;1. The user has to su - otherwise the /etc/profile is not run and therefore my script is not run thus defeating my security measures. &lt;BR /&gt;&lt;BR /&gt;2. Because of the way the script works, it&lt;BR /&gt;does not allow su-ing from other scripts. &lt;BR /&gt;</description>
      <pubDate>Tue, 17 Oct 2000 15:54:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454485#M759817</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2000-10-17T15:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454486#M759818</link>
      <description>have you thought putting in you users .profile or .kshrc an alias of su ?&lt;BR /&gt;&lt;BR /&gt;alias su='su -'&lt;BR /&gt;&lt;BR /&gt;Just thoughts...&lt;BR /&gt;Regards&lt;BR /&gt;Victor</description>
      <pubDate>Tue, 17 Oct 2000 16:00:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454486#M759818</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2000-10-17T16:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454487#M759819</link>
      <description>I thought of that Victor but they can get past it with '/usr/bin/su'.&lt;BR /&gt;&lt;BR /&gt;Without using restricted shells, I believe that the only way around it is to make /usr/bin/su unavailable to normal users by changing its permissions and writing a 'wrapper' script which has the setuid bit set to allow it to call su but which checks the calling user's credentials first.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Oct 2000 16:15:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454487#M759819</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2000-10-17T16:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454488#M759820</link>
      <description>Or using sudo to do su- since you have changed perms on /usr/bin/su to be executable to root only?&lt;BR /&gt;&lt;BR /&gt;What do you think John (and again congratulation...)&lt;BR /&gt;Best regards&lt;BR /&gt;Victor&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Oct 2000 16:27:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454488#M759820</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2000-10-17T16:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454489#M759821</link>
      <description>These are very good answers wrt to the su&lt;BR /&gt;situation.  I didn't want to have to resort to using sudo, but I like the idea of the wrapper script to replace su.&lt;BR /&gt;&lt;BR /&gt;My bigger problem right now is that I can not run any scripts that su to other accounts.  This is a big handicap since I work in a development environment where they are constantly installing things as different users and typically I've had to disable my script so that they could install the product and I sometimes forget to re-enble my script (I admin over 60 machines).  Any help in this would be GREATLY appreciated.</description>
      <pubDate>Tue, 17 Oct 2000 17:24:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454489#M759821</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2000-10-17T17:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454490#M759822</link>
      <description>Hi,&lt;BR /&gt;You could use a restricted shell for the user logins and allow only " su - "&lt;BR /&gt;This will ensure the users are always doing su -  instaed of su. Hope this helps.&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Oct 2000 09:02:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454490#M759822</guid>
      <dc:creator>Vinit Adya</dc:creator>
      <dc:date>2000-10-23T09:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454491#M759823</link>
      <description>Santosh, where exactly is your script denying another script the ability to run an su -c?  The two criteria you mentioned (valid parent shell and belonging to the apprpriate group) would both seem valid under those conditions.  What test are you performing in your script that breaks these other scripts?</description>
      <pubDate>Mon, 23 Oct 2000 14:16:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricted-logins/m-p/2454491#M759823</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2000-10-23T14:16:54Z</dc:date>
    </item>
  </channel>
</rss>

