<?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: Disable password aging. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968643#M752803</link>
    <description>This should do it for you:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TDIR=${TMPDIR:-/var/tmp}&lt;BR /&gt;PID=${$}&lt;BR /&gt;A1=${TDIR}/A${PID}_1.awk&lt;BR /&gt;&lt;BR /&gt;INFILE=/etc/passwd&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt; !EOF! &amp;gt; ${A1}&lt;BR /&gt;{&lt;BR /&gt;  n = split(\$0,aray,":")&lt;BR /&gt;  if (n &amp;gt;= 2)&lt;BR /&gt;    {&lt;BR /&gt;      n2 = split(aray[2],bray,",");&lt;BR /&gt;      if (n2 &amp;gt; 1) aray[2] = bray[1]&lt;BR /&gt;      i = 1&lt;BR /&gt;      while (i &amp;lt; n)&lt;BR /&gt;        {&lt;BR /&gt;          printf("%s:",aray[i])&lt;BR /&gt;          ++i&lt;BR /&gt;        }&lt;BR /&gt;      printf("%s\n",aray[i])&lt;BR /&gt;    }&lt;BR /&gt;  else printf("%s\n",\$0) &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;!EOF!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk -f ${A1} &amp;lt; ${INFILE}&lt;BR /&gt;STAT=${?}&lt;BR /&gt;rm -f ${A1}&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;----------------------------&lt;BR /&gt;&lt;BR /&gt;It will read /etc/passwd and write the updated version on stdout. You can them copy the updated version to /etc/passwd. If you are running NIS, then change the input from awk &amp;lt; ${INFILE} to ypcat passwd | awk.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Anytime you do something like this, I suggest that 1) you make a backup copy of /etc/passwd 2) you are logged in as root in two sessions.&lt;BR /&gt;&lt;BR /&gt;If you follow these rules, you can always get yourself out of trouble almost as fast as you got yourself in.&lt;BR /&gt;</description>
    <pubDate>Thu, 08 May 2003 17:26:11 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2003-05-08T17:26:11Z</dc:date>
    <item>
      <title>Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968635#M752795</link>
      <description>Is there a way (outside of sam) to disable password aging.  I want no longer want this account to have password aging policies.  This is not a trusted system.</description>
      <pubDate>Thu, 08 May 2003 15:29:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968635#M752795</guid>
      <dc:creator>Sam  Lalonde</dc:creator>
      <dc:date>2003-05-08T15:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968636#M752796</link>
      <description>&lt;BR /&gt;passwd -x &lt;MAX&gt;&lt;BR /&gt;&lt;BR /&gt;where max is the number of days before it is expired. Set to the largest value allowed; 441 &lt;BR /&gt;&lt;/MAX&gt;</description>
      <pubDate>Thu, 08 May 2003 15:51:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968636#M752796</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2003-05-08T15:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968637#M752797</link>
      <description>You can disable password aging for single accounts by editing /etc/passwd and removing from the comma and character between the next ":" in the password field. (jdoe:XXXXX:,Y:) In this case remove ",Y".</description>
      <pubDate>Thu, 08 May 2003 15:55:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968637#M752797</guid>
      <dc:creator>Ron Jobke_1</dc:creator>
      <dc:date>2003-05-08T15:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968638#M752798</link>
      <description>You can also edit the password file and remove the characters the define the password aging period in the encrypted password field.&lt;BR /&gt;# vipw&lt;BR /&gt;..to edit the password file.&lt;BR /&gt;Example ..&lt;BR /&gt;skchan:djfghsDipBwQA,O28P: ..&lt;BR /&gt;would become&lt;BR /&gt;skchan:djfghsDipBwQA: ...</description>
      <pubDate>Thu, 08 May 2003 15:58:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968638#M752798</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2003-05-08T15:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968639#M752799</link>
      <description>I have 20 accounts on each of 40 servers.  I was looking for a way to do it on the command line so I can script something.</description>
      <pubDate>Thu, 08 May 2003 16:27:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968639#M752799</guid>
      <dc:creator>Sam  Lalonde</dc:creator>
      <dc:date>2003-05-08T16:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968640#M752800</link>
      <description>&lt;BR /&gt;#passwd -n 0 -x 0  username This can be done on a non-trusted system&lt;BR /&gt;&lt;BR /&gt;-USA..&lt;BR /&gt;</description>
      <pubDate>Thu, 08 May 2003 16:50:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968640#M752800</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2003-05-08T16:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968641#M752801</link>
      <description>I hit submit too fast.. &lt;BR /&gt;The above method force user to change his password during next login.&lt;BR /&gt;&lt;BR /&gt;If this is not OK then use the method given Chan by editing /etc/passwd file&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 May 2003 16:52:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968641#M752801</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2003-05-08T16:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968642#M752802</link>
      <description>this script should point you in the right direction:&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;cat /etc/passwd | &lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;echo $line | sed 's/,?*:/:/g' &amp;gt;&amp;gt; passwd.new&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;#end of script&lt;BR /&gt;&lt;BR /&gt;now after you have finished this you could just copy the passwd.new into /etc/passwd&lt;BR /&gt;NOTE: you may wish to backup the /etc/passwd file prior to overwritting it.</description>
      <pubDate>Thu, 08 May 2003 17:24:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968642#M752802</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-05-08T17:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968643#M752803</link>
      <description>This should do it for you:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TDIR=${TMPDIR:-/var/tmp}&lt;BR /&gt;PID=${$}&lt;BR /&gt;A1=${TDIR}/A${PID}_1.awk&lt;BR /&gt;&lt;BR /&gt;INFILE=/etc/passwd&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt; !EOF! &amp;gt; ${A1}&lt;BR /&gt;{&lt;BR /&gt;  n = split(\$0,aray,":")&lt;BR /&gt;  if (n &amp;gt;= 2)&lt;BR /&gt;    {&lt;BR /&gt;      n2 = split(aray[2],bray,",");&lt;BR /&gt;      if (n2 &amp;gt; 1) aray[2] = bray[1]&lt;BR /&gt;      i = 1&lt;BR /&gt;      while (i &amp;lt; n)&lt;BR /&gt;        {&lt;BR /&gt;          printf("%s:",aray[i])&lt;BR /&gt;          ++i&lt;BR /&gt;        }&lt;BR /&gt;      printf("%s\n",aray[i])&lt;BR /&gt;    }&lt;BR /&gt;  else printf("%s\n",\$0) &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;!EOF!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk -f ${A1} &amp;lt; ${INFILE}&lt;BR /&gt;STAT=${?}&lt;BR /&gt;rm -f ${A1}&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;----------------------------&lt;BR /&gt;&lt;BR /&gt;It will read /etc/passwd and write the updated version on stdout. You can them copy the updated version to /etc/passwd. If you are running NIS, then change the input from awk &amp;lt; ${INFILE} to ypcat passwd | awk.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Anytime you do something like this, I suggest that 1) you make a backup copy of /etc/passwd 2) you are logged in as root in two sessions.&lt;BR /&gt;&lt;BR /&gt;If you follow these rules, you can always get yourself out of trouble almost as fast as you got yourself in.&lt;BR /&gt;</description>
      <pubDate>Thu, 08 May 2003 17:26:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968643#M752803</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-05-08T17:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968644#M752804</link>
      <description>Clay - you always find a more complicated (but probably better) way do do things :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Great recommendation about having 2 login sessions.... that way if the one craps out and /etc/passwd is broken  the second window is already loged on and able to fix things</description>
      <pubDate>Thu, 08 May 2003 17:31:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968644#M752804</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-05-08T17:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Disable password aging.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968645#M752805</link>
      <description>This should work .. I'm doing this in command line .. you can script this and run it on each server. Assuming you got all the 20 usernames in a file "fileA" in /tmp.&lt;BR /&gt;# cd /etc&lt;BR /&gt;# cp passwd passwd.org&lt;BR /&gt;# for i in `cat /tmp/fileA`&lt;BR /&gt;&amp;gt; do&lt;BR /&gt;&amp;gt; passwd -x 0 $i&lt;BR /&gt;&amp;gt; done&lt;BR /&gt;Afetrwards you should see that the first char after the comma should be set to ".", example ..&lt;BR /&gt;Before&lt;BR /&gt;skchan:XXX,022P:&lt;BR /&gt;After&lt;BR /&gt;skchan:XXX,.2AP:&lt;BR /&gt;Ignore the last 2 chars (ie A and P) because that denotes when the password is last changed. The first 2 chars ( ie . and 2) means represent..&lt;BR /&gt;. = 0 weeks (max num of weeks the password is valid)&lt;BR /&gt;2 = 4 weeks (min num of weeks that has to pass before the password can be changed). After this change the password should not expire, the first char will remain as "." even though the user change his/her password. Test it first .. I hope I'm not wrong.&lt;BR /&gt;</description>
      <pubDate>Thu, 08 May 2003 17:32:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-password-aging/m-p/2968645#M752805</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2003-05-08T17:32:36Z</dc:date>
    </item>
  </channel>
</rss>

