<?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 Deny Login Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954807#M414407</link>
    <description>I am running an INFORMIX database on a HP-UX server. Because informix requires a user id be on the system running the database, I need to deny every user login rights for telnet or SSH except admins. I created a script and placed it in the users .profile file. but I get an error when it hits the 'exit' line. How do I hide the error or make it work correctly to just kick out the user? Also the $name does not display the name when runing it from sh. It worked in csh.&lt;BR /&gt;&lt;BR /&gt;set name = `whoami`&lt;BR /&gt;echo ""&lt;BR /&gt;echo "*************************************************"&lt;BR /&gt;echo "***  You do not have permission to log into   ***"&lt;BR /&gt;echo "***  this system if you feel this is an error ***"&lt;BR /&gt;echo "***  Please contact your Administrator        ***"&lt;BR /&gt;echo "*************************************************"&lt;BR /&gt;echo ""&lt;BR /&gt;echo ""&lt;BR /&gt;&lt;BR /&gt;sleep 2&lt;BR /&gt;echo $name | mailx -s "User tried to login using telnet" hta_admin&lt;BR /&gt;exec exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please help...I need all the help I can get :)&lt;BR /&gt;Thanks,&lt;BR /&gt;Chris</description>
    <pubDate>Tue, 24 Jan 2006 15:02:27 GMT</pubDate>
    <dc:creator>Chris Weislak</dc:creator>
    <dc:date>2006-01-24T15:02:27Z</dc:date>
    <item>
      <title>Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954807#M414407</link>
      <description>I am running an INFORMIX database on a HP-UX server. Because informix requires a user id be on the system running the database, I need to deny every user login rights for telnet or SSH except admins. I created a script and placed it in the users .profile file. but I get an error when it hits the 'exit' line. How do I hide the error or make it work correctly to just kick out the user? Also the $name does not display the name when runing it from sh. It worked in csh.&lt;BR /&gt;&lt;BR /&gt;set name = `whoami`&lt;BR /&gt;echo ""&lt;BR /&gt;echo "*************************************************"&lt;BR /&gt;echo "***  You do not have permission to log into   ***"&lt;BR /&gt;echo "***  this system if you feel this is an error ***"&lt;BR /&gt;echo "***  Please contact your Administrator        ***"&lt;BR /&gt;echo "*************************************************"&lt;BR /&gt;echo ""&lt;BR /&gt;echo ""&lt;BR /&gt;&lt;BR /&gt;sleep 2&lt;BR /&gt;echo $name | mailx -s "User tried to login using telnet" hta_admin&lt;BR /&gt;exec exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please help...I need all the help I can get :)&lt;BR /&gt;Thanks,&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 24 Jan 2006 15:02:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954807#M414407</guid>
      <dc:creator>Chris Weislak</dc:creator>
      <dc:date>2006-01-24T15:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954808#M414408</link>
      <description>Shalom Chris,&lt;BR /&gt;&lt;BR /&gt;You can build something into /etc/profile that checks the $LOGNAME variable and ejects users that are not allowed to log in.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 24 Jan 2006 15:08:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954808#M414408</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-01-24T15:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954809#M414409</link>
      <description>I just figured out the $name..I used $USER instead and got what I wanted. I still get the error though when I login that exit is not a vaild command.&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 24 Jan 2006 15:09:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954809#M414409</guid>
      <dc:creator>Chris Weislak</dc:creator>
      <dc:date>2006-01-24T15:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954810#M414410</link>
      <description>Chris,&lt;BR /&gt;&lt;BR /&gt;Perhaps the "/etc/nologin" feature of the /etc/default/security file would be of help to you.  Take a look at the man page for "security".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 24 Jan 2006 15:09:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954810#M414410</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-01-24T15:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954811#M414411</link>
      <description>On another note, what happens if you just do "exit" rather than "exec exit"?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 24 Jan 2006 15:10:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954811#M414411</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-01-24T15:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954812#M414412</link>
      <description>Be sure to put a "trap" statement to make sure the user can not break out the profile.&lt;BR /&gt; &lt;BR /&gt;I don't think you need "exec" in front of "exit" either.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 24 Jan 2006 15:10:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954812#M414412</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2006-01-24T15:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954813#M414413</link>
      <description>I removed the exec and that worked. I think I used it with the csh. How do you "trap" the user so they cannot get out of the script? Forgive me I am very new to the scripting side of UNIX.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 24 Jan 2006 15:17:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954813#M414413</guid>
      <dc:creator>Chris Weislak</dc:creator>
      <dc:date>2006-01-24T15:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954814#M414414</link>
      <description>Hi Chris:&lt;BR /&gt;&lt;BR /&gt;# trap '' INT QUIT HUP&lt;BR /&gt;&lt;BR /&gt;...will provide good protection.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Jan 2006 15:26:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954814#M414414</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-01-24T15:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954815#M414415</link>
      <description>trap "" 1 2 3 # ignore HUP, INT, QUIT now.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 24 Jan 2006 15:29:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954815#M414415</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-01-24T15:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954816#M414416</link>
      <description>Those suggestions worked great. Now the script works clean and you cannot quit it during the time it is running. You all rock...&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 24 Jan 2006 15:39:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954816#M414416</guid>
      <dc:creator>Chris Weislak</dc:creator>
      <dc:date>2006-01-24T15:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Deny Login Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954817#M414417</link>
      <description>Hi (again) Chris:&lt;BR /&gt;&lt;BR /&gt;Oh, it looks kike your using a C-shell (csh) script.  In that case use this:&lt;BR /&gt;&lt;BR /&gt;# onintr -&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Jan 2006 15:40:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-login-script/m-p/4954817#M414417</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-01-24T15:40:30Z</dc:date>
    </item>
  </channel>
</rss>

