<?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: how restrict any user from logging remotely ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588112#M753254</link>
    <description>I know this is an old thread and there are several others here, about adding stuff to /etc/profile.&lt;BR /&gt;&lt;BR /&gt;Just a word of caution, if you add any script language that uses commands from /usr/bin, like sed, getip, etc. then the script will prevent you from booting in single user mode, since /usr is not mounted when /etc/profile is executed.&lt;BR /&gt;</description>
    <pubDate>Wed, 05 Jun 2002 15:22:27 GMT</pubDate>
    <dc:creator>Fred Martin_1</dc:creator>
    <dc:date>2002-06-05T15:22:27Z</dc:date>
    <item>
      <title>how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588100#M753242</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;On HP-UX V10.20, how can I restrict any user from logging remotely ?&lt;BR /&gt;I would like that the only way to connect as this "restriced user" is :&lt;BR /&gt;- on the console ;&lt;BR /&gt;- by "su" from "non-restricted user".&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;GRP</description>
      <pubDate>Tue, 02 Oct 2001 11:15:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588100#M753242</guid>
      <dc:creator>PUJOL Gregory</dc:creator>
      <dc:date>2001-10-02T11:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588101#M753243</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;you can find information about this in&lt;BR /&gt;man hosts.equiv (for rlogin configuration) or&lt;BR /&gt;man inetd.sec (for telnet/ftp access).&lt;BR /&gt;Another way to configure user access is to use SAM:&lt;BR /&gt;&lt;BR /&gt;sam Areas-&amp;gt;Networking and Communication-&amp;gt;System Access&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Torsten</description>
      <pubDate>Tue, 02 Oct 2001 11:35:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588101#M753243</guid>
      <dc:creator>Torsten.</dc:creator>
      <dc:date>2001-10-02T11:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588102#M753244</link>
      <description>I've been able to do this by modifying the /etc/profile so that it check if someone is trying to log in directly as the restricted user and if so, issue an error message and exit.&lt;BR /&gt;&lt;BR /&gt;The way to check if the user is logging in directly is to see the parent process of the shell, it should be another shell and not rlogind or telnetd.  I can post my script if you'd like.&lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Tue, 02 Oct 2001 11:39:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588102#M753244</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2001-10-02T11:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588103#M753245</link>
      <description>I do this similarly to how Santosh does, that is, using /etc/profile, but I check to see if the userID is that restricted user and then check the TTY that is being used.  Unless it is /dev/console, then it is not allowed.</description>
      <pubDate>Tue, 02 Oct 2001 14:04:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588103#M753245</guid>
      <dc:creator>Bernie Vande Griend</dc:creator>
      <dc:date>2001-10-02T14:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588104#M753246</link>
      <description>yes, i'd like to see your script.&lt;BR /&gt;thanks.</description>
      <pubDate>Tue, 02 Oct 2001 14:05:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588104#M753246</guid>
      <dc:creator>PUJOL Gregory</dc:creator>
      <dc:date>2001-10-02T14:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588105#M753247</link>
      <description>I added this to my /etc/profile a long time ago. It worked just fine. &lt;BR /&gt;just touch a file called nologin in /etc.  if it exists then it will only allow the following users in. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if [ -r /etc/nologin ]&lt;BR /&gt;then&lt;BR /&gt;case $LOGNAME in&lt;BR /&gt; root ) ;;  &lt;BR /&gt; bmarkus ) ;;  &lt;BR /&gt; oracle ) ;;  &lt;BR /&gt;&lt;BR /&gt;esac&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Good luck&lt;BR /&gt;&lt;BR /&gt;Hope it helps&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Tue, 02 Oct 2001 15:50:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588105#M753247</guid>
      <dc:creator>Brian Markus</dc:creator>
      <dc:date>2001-10-02T15:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588106#M753248</link>
      <description>Brian,&lt;BR /&gt;&lt;BR /&gt;Wouldn't that just effectively prevent anyone from logging in as those users...even an su wouldn't work (?).&lt;BR /&gt;&lt;BR /&gt;Anyway, I've attached my script.  I also make the following changes to /etc/profile:&lt;BR /&gt;&lt;BR /&gt;------cut here-----&lt;BR /&gt;UID=`id -u`&lt;BR /&gt;&lt;BR /&gt;if [ -f /etc/nologin -a ! $UID = 0 ]&lt;BR /&gt;then&lt;BR /&gt;        echo "Machine not yet available"&lt;BR /&gt;        exit 0&lt;BR /&gt;fi&lt;BR /&gt;if [ ! -d ${HOME} ]&lt;BR /&gt;then&lt;BR /&gt;        echo "Unable to change directory to ${HOME}"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;# Check if in multiuser mode (i.e. runlevel is 3 or 4)&lt;BR /&gt;&lt;BR /&gt;set `/usr/bin/who -r`&lt;BR /&gt;RL=$3&lt;BR /&gt;set --&lt;BR /&gt;if [ $RL = 3 -o $RL = 4 ] &amp;amp;&amp;amp; [ `/usr/bin/tty` != /dev/console ]&lt;BR /&gt;then&lt;BR /&gt;        if [ -f /etc/checkuser ];then&lt;BR /&gt;                . /etc/checkuser&lt;BR /&gt;        fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;------cut here-----&lt;BR /&gt;The script is called checkuser.  I create a special group, i.e. su_&lt;USER&gt;, where &lt;USER&gt; is the account that I'm trying to restrict.  This allows me to restrict direct logins as that user and also allows me to say WHO can log in as that user.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;-Santosh&lt;/USER&gt;&lt;/USER&gt;</description>
      <pubDate>Tue, 02 Oct 2001 17:09:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588106#M753248</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2001-10-02T17:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588107#M753249</link>
      <description>create the file /etc/securetty and add console&lt;BR /&gt;on a single line&lt;BR /&gt;&lt;BR /&gt;echo "console" &amp;gt; /etc/securetty&lt;BR /&gt;&lt;BR /&gt;Then only the console will allow direct root logins. All&lt;BR /&gt;remote logins must be made with regular accounts &lt;BR /&gt;and then they can "su" to root.</description>
      <pubDate>Tue, 02 Oct 2001 18:04:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588107#M753249</guid>
      <dc:creator>Kim Kendall_1</dc:creator>
      <dc:date>2001-10-02T18:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588108#M753250</link>
      <description>Keep in mind that not all logins use /etc/profile, specifically csh users.  You would need to make appropriate changes for those shells also (csh uses /etc/csh.login).&lt;BR /&gt;&lt;BR /&gt;/etc/profile and /etc/csh.login are not executed for "su loginid", but are executed for "su - loginid".  That means that after someone logs in they could "su loginid" regardless of any checks in profile or csh.login.  However, to allow "su - loginid" to bypass the edit for being on the console you would need to determine it the user is su'ing.  You could do something like:&lt;BR /&gt;loginid=`who am i|awk '{print $1}'`&lt;BR /&gt;suid=`/usr/bin/whoami`&lt;BR /&gt;if [ $loginid = $suid ]&lt;BR /&gt;then&lt;BR /&gt;        #check to see if on console&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;This works because "whoami" returns the suid while "who am i" returns the loginid.  If they are the same the user is probably logging in.  If different, they are su'ing.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Tue, 02 Oct 2001 19:52:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588108#M753250</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2001-10-02T19:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588109#M753251</link>
      <description>I had a situation where I wanted to control who logged in remotely, i.e. from another network, and I wanted to control it by who they were.&lt;BR /&gt;&lt;BR /&gt;So I created a group in /etc/group, and this became the access list for who was allowed in.&lt;BR /&gt;&lt;BR /&gt;Then, in /etc/profile, I added a section at the top that 1) determined if they were coming from another network, and if so 2) checked to see if the user was a member of the group.&lt;BR /&gt;&lt;BR /&gt;The script logged them out if 1 was true but 2 was false.&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Oct 2001 14:59:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588109#M753251</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2001-10-03T14:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588110#M753252</link>
      <description>Forgot to mention, there is a thread here somewhere with my name on it, as we discussed some of the details when I set that up.&lt;BR /&gt;&lt;BR /&gt;Also note that my solution will also prevent someone from logging in from another network, and then su'ing to another user unless that user is also in the access list.  This because /etc/profile will run again for the su.&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Oct 2001 15:03:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588110#M753252</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2001-10-03T15:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588111#M753253</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;do not forget the other ways of loggin in:&lt;BR /&gt;- remote shell: remsh&lt;BR /&gt;- secure shell: ssh&lt;BR /&gt;- X-Windows/CDE: XDMCP&lt;BR /&gt;- NFS remote execution: on&lt;BR /&gt;&lt;BR /&gt;You will have to block those, too.&lt;BR /&gt;For "remsh" and "ssh" you may use "/var/adm/inetd.sec",&lt;BR /&gt;for "XDMCP" (X Windows Display Manager Protocol) you&lt;BR /&gt;can restrict it in "/etc/dt/config/Xsetup", and for the "on"&lt;BR /&gt;command in "/etc/inetd.conf".&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Wodisch&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Oct 2001 00:33:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588111#M753253</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2001-10-05T00:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: how restrict any user from logging remotely ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588112#M753254</link>
      <description>I know this is an old thread and there are several others here, about adding stuff to /etc/profile.&lt;BR /&gt;&lt;BR /&gt;Just a word of caution, if you add any script language that uses commands from /usr/bin, like sed, getip, etc. then the script will prevent you from booting in single user mode, since /usr is not mounted when /etc/profile is executed.&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jun 2002 15:22:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-restrict-any-user-from-logging-remotely/m-p/2588112#M753254</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2002-06-05T15:22:27Z</dc:date>
    </item>
  </channel>
</rss>

