<?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: passwd question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867415#M747723</link>
    <description>We can control One Session (login) per user as,&lt;BR /&gt;&lt;BR /&gt;/etc/profile&lt;BR /&gt;&lt;BR /&gt;who | grep -q '$LOGNAME'&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;  echo "$LOGNAME is already logged"&lt;BR /&gt;  sleep 2&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
    <pubDate>Tue, 26 Oct 2004 08:57:04 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2004-10-26T08:57:04Z</dc:date>
    <item>
      <title>passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867411#M747719</link>
      <description>I have a query from the mgmt reg. the passwd.&lt;BR /&gt;&lt;BR /&gt;They need a faster answer and I do not have enough time to search the web/docs. Sorry for that.&lt;BR /&gt;&lt;BR /&gt;Needs to know what are the possibilities for the below:&lt;BR /&gt;&lt;BR /&gt;-One session (login) per user.&lt;BR /&gt;-More than 5 days &amp;amp; user id not used = Disable&lt;BR /&gt;-3 month &amp;amp; user id not use = Archive&lt;BR /&gt;&lt;BR /&gt;The system currently is not trusted. I am more concerned with the one session per user request. Please advise.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Rasheed.</description>
      <pubDate>Tue, 26 Oct 2004 08:25:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867411#M747719</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2004-10-26T08:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867412#M747720</link>
      <description>You can modify /etc/profile to deal with single session only.&lt;BR /&gt;&lt;BR /&gt;user=$(whoami)&lt;BR /&gt;usersessions=$(who | grep $user)&lt;BR /&gt;if [ $usersessions -ge 1 ]&lt;BR /&gt;then&lt;BR /&gt;    echo "Already logged in"&lt;BR /&gt;    exit&lt;BR /&gt;else&lt;BR /&gt;    echo "logging in"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Note:&lt;BR /&gt;&lt;BR /&gt;If you name a user the same name as a normally running process, this code will cause users to be unjustly prevented from acesssing the system.&lt;BR /&gt;&lt;BR /&gt;run ps -ef and make note of any possible conflicts, adjust your code accordingly.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 26 Oct 2004 08:37:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867412#M747720</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-10-26T08:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867413#M747721</link>
      <description>For one session, modify the /etc/profile:&lt;BR /&gt;&lt;BR /&gt;user=`echo $LOGNAME`&lt;BR /&gt;user_count=`who | grep $user | wc -l`&lt;BR /&gt;if ( $user_count &amp;gt; 1 ) then&lt;BR /&gt;echo "You have exceeded the max number of logins allowed"&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;More then 5 days, you will have to parse with the last command - same for 3 months...&lt;BR /&gt;&lt;BR /&gt;Rgd...Geoff&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Oct 2004 08:39:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867413#M747721</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-10-26T08:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867414#M747722</link>
      <description>Forgot to try and answer these questions.&lt;BR /&gt;&lt;BR /&gt;-More than 5 days &amp;amp; user id not used = Disable&lt;BR /&gt;-3 month &amp;amp; user id not use = Archive&lt;BR /&gt;&lt;BR /&gt;These options are very easy with trusted system. You could convert and then a few menu options in sam and you are done.&lt;BR /&gt;&lt;BR /&gt;You could use the output of passwd -sa to write a custom script to do this though.&lt;BR /&gt;&lt;BR /&gt;You might also need to match it against the output of the last command.&lt;BR /&gt;&lt;BR /&gt;I would not delete users I would use the passwd -l command to lock the account. To actually delete the user is needless work for your operations department, or worse you, if you are stuck adding users.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 26 Oct 2004 08:43:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867414#M747722</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-10-26T08:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867415#M747723</link>
      <description>We can control One Session (login) per user as,&lt;BR /&gt;&lt;BR /&gt;/etc/profile&lt;BR /&gt;&lt;BR /&gt;who | grep -q '$LOGNAME'&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;  echo "$LOGNAME is already logged"&lt;BR /&gt;  sleep 2&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Tue, 26 Oct 2004 08:57:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867415#M747723</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-26T08:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867416#M747724</link>
      <description>We get use last successful login as,&lt;BR /&gt;&lt;BR /&gt;last -1 &lt;USERNAME&gt; &lt;BR /&gt;It will give time and date informations there.&lt;BR /&gt;&lt;BR /&gt;date +'%b %d' will give month date&lt;BR /&gt;last -1 &lt;USERNAME&gt; | awk '{ print $4" "$5 }'&lt;BR /&gt;will give last successful login of a user&lt;BR /&gt;&lt;BR /&gt;Using this time , make script to get day difference and lock the user as,&lt;BR /&gt;&lt;BR /&gt; passwd -l &lt;USERNAME&gt;&lt;BR /&gt;&lt;BR /&gt;I did not get on this,&lt;BR /&gt;-3 month &amp;amp; user id not use = Archive&lt;BR /&gt;Archieve means? can you give details more on this.&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;/USERNAME&gt;&lt;/USERNAME&gt;&lt;/USERNAME&gt;</description>
      <pubDate>Tue, 26 Oct 2004 09:36:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867416#M747724</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-26T09:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867417#M747725</link>
      <description>Hi Muthu,&lt;BR /&gt;I just inherited the exact words of the mgmt. Archiving means, user should be disabled (I guess!!!). Yep, it is just that.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 27 Oct 2004 02:17:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867417#M747725</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2004-10-27T02:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867418#M747726</link>
      <description>Hi Rasheed,&lt;BR /&gt;&lt;BR /&gt;If this is a 11.0 system with latest patches or a 11i system, then you can configure /etc/default/security file with the following option&lt;BR /&gt;&lt;BR /&gt;NUMBER_OF_LOGINS_ALLOWED 1&lt;BR /&gt;&lt;BR /&gt;This will limit the number of login sessions to one. There are more options available also. Check 'man security' for more options.&lt;BR /&gt;&lt;BR /&gt;Aging parameters are bit tricky on non-trusted systems. Look at 'man 4 passwd' command for more options on setting up the expiration. Look at the section that explains the scenario where m&amp;gt;M in the password encryption string after the qualifier ",".&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 27 Oct 2004 02:28:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867418#M747726</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-10-27T02:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867419#M747727</link>
      <description>If you are using HPUX 11i or HP UX 11 with latest patch you can acheive it (One session per user) using /etc/default/security &lt;BR /&gt;&lt;BR /&gt;These lines from man security&lt;BR /&gt;&lt;BR /&gt;NUMBER_OF_LOGINS_ALLOWED&lt;BR /&gt;          This parameter controls the number of simultaneous&lt;BR /&gt;          logins allowed per user.  This is applicable only for&lt;BR /&gt;          non-root users.&lt;BR /&gt;&lt;BR /&gt;          NUMBER_OF_LOGINS_ALLOWED=0   Any number of logins are&lt;BR /&gt;          allowed per user.&lt;BR /&gt;&lt;BR /&gt;          NUMBER_OF_LOGINS_ALLOWED=N   N number of logins are allowed per user.&lt;BR /&gt;&lt;BR /&gt;Default value: NUMBER_OF_LOGINS_ALLOWED=0&lt;BR /&gt;&lt;BR /&gt;If system is in trusted mode you can acheive More than 5 days &amp;amp; user id not used = Disable&lt;BR /&gt; use usemod command with -f option for this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sunil</description>
      <pubDate>Wed, 27 Oct 2004 02:53:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867419#M747727</guid>
      <dc:creator>Sunil Sharma_1</dc:creator>
      <dc:date>2004-10-27T02:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867420#M747728</link>
      <description>If I were you, I would make a new forum thread about disabling accounts after 5 days.&lt;BR /&gt;&lt;BR /&gt;I assume you would not have your system in a trusted mode.  How would you do it by hand?    &lt;BR /&gt;You can see people that logged in in the last X days by running the last command.&lt;BR /&gt;&lt;BR /&gt;Then you would count the number of days between today and their last login.  (look for date calc utility in the forums).&lt;BR /&gt;&lt;BR /&gt;You could get the list of users in the last command for the last 5 days.  And compare it to the list of actual users in the passwd file.  The users that are in the passwd file, but not in the list of "lastusers" would need to be disabled.  Also, you might have a set of users you never disable (system accounts).  So now you have a list of users to disable.&lt;BR /&gt;&lt;BR /&gt;You run vipw to edit the passwd file.  To disable an account, put an asterisk in the password field of the user's account.   &lt;BR /&gt;&lt;BR /&gt;Now how would you do this automatically?&lt;BR /&gt;I would make a unix or perl script that runs at 1 am each night. &lt;BR /&gt;script part1:  use sed,grep,last,awk, time-calc,date,sort, and uniq to get a list of users that logged in in the past 5 days.  I'll call the list good_users.&lt;BR /&gt;script part2:  make list of all users from the passwd file, remove system users from the list, remove already disabled users from the list.  I'll call this list normal_users.&lt;BR /&gt;script part3:  make a new list of accounts to disable:  Userids in "normal_users" but not in "good_users."  Call this new list evil_users.&lt;BR /&gt;script part4:  For each userid in "evil_users", change the password for them to "*".&lt;BR /&gt;&lt;BR /&gt;Now about 30 days?  If the requirement is the same as the 5 day requirement, you really have nothing to do.&lt;BR /&gt;One last thing.  What about users that have not logged in for the last 5 days, but they never logged off?&lt;BR /&gt;You might want to look for and script to kick out idle users.  &lt;BR /&gt;&lt;BR /&gt;steve</description>
      <pubDate>Wed, 27 Oct 2004 07:48:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867420#M747728</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2004-10-27T07:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867421#M747729</link>
      <description>If using the NUMBER_OF_LOGINS_ALLOWED feature be sure to check patches PHCO_27694 and PHCO_27721.  Also, if using the grep solution, beware of the problem of doing a grep for user 'root' while user 'rootuser' is logged in. You don't want false matches on a subset of the user name!</description>
      <pubDate>Wed, 27 Oct 2004 15:06:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867421#M747729</guid>
      <dc:creator>doug hosking</dc:creator>
      <dc:date>2004-10-27T15:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: passwd question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867422#M747730</link>
      <description>Thanks for the responses.</description>
      <pubDate>Sat, 30 Oct 2004 06:39:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passwd-question/m-p/4867422#M747730</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2004-10-30T06:39:34Z</dc:date>
    </item>
  </channel>
</rss>

