<?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: script wanted about user login in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-wanted-about-user-login/m-p/3313697#M186079</link>
    <description>If they have shell access, you can add the shell variable 'TMOUT' to each one. The sh-posix man page has details.&lt;BR /&gt;&lt;BR /&gt;You could as an alternative use another method, and that is add some lines of code to the /etc/profile file, where it evaluates the number of users logged in, and if there are 300 already, it will log them out.&lt;BR /&gt;&lt;BR /&gt;This post should help&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=534189" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=534189&lt;/A&gt;</description>
    <pubDate>Wed, 23 Jun 2004 21:24:28 GMT</pubDate>
    <dc:creator>Michael Tully</dc:creator>
    <dc:date>2004-06-23T21:24:28Z</dc:date>
    <item>
      <title>script wanted about user login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-wanted-about-user-login/m-p/3313696#M186078</link>
      <description>I want to control the no. of user login , the max. of login is limited to 300 , but it always over 300 logins at the peak hour , so I want to kill five users who are idle for most long time  because I want to remain the no. of login to 295 , can suggest how to write the shell script ? thx.</description>
      <pubDate>Wed, 23 Jun 2004 20:33:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-wanted-about-user-login/m-p/3313696#M186078</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-06-23T20:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: script wanted about user login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-wanted-about-user-login/m-p/3313697#M186079</link>
      <description>If they have shell access, you can add the shell variable 'TMOUT' to each one. The sh-posix man page has details.&lt;BR /&gt;&lt;BR /&gt;You could as an alternative use another method, and that is add some lines of code to the /etc/profile file, where it evaluates the number of users logged in, and if there are 300 already, it will log them out.&lt;BR /&gt;&lt;BR /&gt;This post should help&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=534189" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=534189&lt;/A&gt;</description>
      <pubDate>Wed, 23 Jun 2004 21:24:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-wanted-about-user-login/m-p/3313697#M186079</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2004-06-23T21:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: script wanted about user login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-wanted-about-user-login/m-p/3313698#M186080</link>
      <description>thx Michael's reply,&lt;BR /&gt;&lt;BR /&gt;I find the script that u provide , it will kill the idle process that idle over a certain time , but I want a script that is more intelligence , it can kill the logins their idle time are the most long in the system , do anyone have such script ? thx.</description>
      <pubDate>Wed, 23 Jun 2004 23:16:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-wanted-about-user-login/m-p/3313698#M186080</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-06-23T23:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: script wanted about user login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-wanted-about-user-login/m-p/3313699#M186081</link>
      <description>hai,&lt;BR /&gt;&lt;BR /&gt; We can get the idle time of users with who -u or w command. &lt;BR /&gt;&lt;BR /&gt; #!/usr/bin/ksh&lt;BR /&gt; # user login control&lt;BR /&gt; &lt;BR /&gt; max=300&lt;BR /&gt; &lt;BR /&gt;while true; do&lt;BR /&gt;&lt;BR /&gt; cnt=`who -R | wc -l` &lt;BR /&gt; kill_cnt=$(($cnt-$max+5))&lt;BR /&gt; loop=0&lt;BR /&gt;&lt;BR /&gt; while [[ $loop -lt $kill_cnt ]]; do&lt;BR /&gt;&lt;BR /&gt;   # send the mail to ip-address&lt;BR /&gt;   echo "you are being idle" &amp;gt; mail `who -Ru | sort -k 6 | tail -1 | awk '{ print $8 }'`   &lt;BR /&gt;&lt;BR /&gt;   # kill them&lt;BR /&gt;   kill -9 `who -Ru | sort -k 6 | tail -1 | awk '{ print $7 }'`&lt;BR /&gt;   let loop=loop+1&lt;BR /&gt; done&lt;BR /&gt; &lt;BR /&gt; # Sleep for some time to synchronize&lt;BR /&gt; sleep 120&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt; It will check and kill the exceeding users&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Muthukumar.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Wed, 23 Jun 2004 23:45:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-wanted-about-user-login/m-p/3313699#M186081</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-06-23T23:45:21Z</dc:date>
    </item>
  </channel>
</rss>

