<?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: changing password in a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-password-in-a-script/m-p/3840792#M273271</link>
    <description>a) you can use this command to fill you file of accounts:&lt;BR /&gt;&lt;BR /&gt;cat /etc/passwd | awk -F : '{ print $1 }' &amp;gt; output.file&lt;BR /&gt;&lt;BR /&gt;b) Or try extending the command with passwd -f.  With passwd -f you force each user to change the password at next login.&lt;BR /&gt;&lt;BR /&gt;cat /output.file | passwd -f (* wild guess *)&lt;BR /&gt;&lt;BR /&gt;Use pwck to verify /etc/passwd.&lt;BR /&gt;&lt;BR /&gt;And copy your /etc/passwd file before starting.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-60103/passwd.1.html" target="_blank"&gt;http://docs.hp.com/en/B2355-60103/passwd.1.html&lt;/A&gt;</description>
    <pubDate>Wed, 09 Aug 2006 22:06:51 GMT</pubDate>
    <dc:creator>Michael Steele_2</dc:creator>
    <dc:date>2006-08-09T22:06:51Z</dc:date>
    <item>
      <title>changing password in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-password-in-a-script/m-p/3840790#M273269</link>
      <description>Hi There&lt;BR /&gt;&lt;BR /&gt;I want to change passwds for all users in a do loop to a same string using a script.&lt;BR /&gt;&lt;BR /&gt;Any idea please&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Nisar</description>
      <pubDate>Wed, 09 Aug 2006 21:13:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-password-in-a-script/m-p/3840790#M273269</guid>
      <dc:creator>Nisar Ahmad</dc:creator>
      <dc:date>2006-08-09T21:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: changing password in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-password-in-a-script/m-p/3840791#M273270</link>
      <description>You can do that by using /usr/sam/lbin/usermod.sam -p &lt;PASSWORD&gt; login_name&lt;BR /&gt;The password here is the encrypted password which you can generate by writing a small c program or other option is to ass a dummy user and assign the password that you want to say "test123" you have the encrypted password in the passwd field in /etc/passwd for that user.&lt;BR /&gt;Now take that string and write a while loop&lt;BR /&gt;while read i&lt;BR /&gt;do&lt;BR /&gt;/usr/sam/lbin/usermod.sam -p &lt;PASSWD&gt; $i&lt;BR /&gt;done&lt;/PASSWD&gt;where /tmp/1 contains all the users whose password you want to set.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Rajeev&lt;/PASSWORD&gt;</description>
      <pubDate>Wed, 09 Aug 2006 21:26:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-password-in-a-script/m-p/3840791#M273270</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2006-08-09T21:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: changing password in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-password-in-a-script/m-p/3840792#M273271</link>
      <description>a) you can use this command to fill you file of accounts:&lt;BR /&gt;&lt;BR /&gt;cat /etc/passwd | awk -F : '{ print $1 }' &amp;gt; output.file&lt;BR /&gt;&lt;BR /&gt;b) Or try extending the command with passwd -f.  With passwd -f you force each user to change the password at next login.&lt;BR /&gt;&lt;BR /&gt;cat /output.file | passwd -f (* wild guess *)&lt;BR /&gt;&lt;BR /&gt;Use pwck to verify /etc/passwd.&lt;BR /&gt;&lt;BR /&gt;And copy your /etc/passwd file before starting.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-60103/passwd.1.html" target="_blank"&gt;http://docs.hp.com/en/B2355-60103/passwd.1.html&lt;/A&gt;</description>
      <pubDate>Wed, 09 Aug 2006 22:06:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-password-in-a-script/m-p/3840792#M273271</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2006-08-09T22:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: changing password in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-password-in-a-script/m-p/3840793#M273272</link>
      <description>Michael, your 'awk' approach needs to consider whether the system is configured to use NIS, netgroups, other repositories, etc.  There may be /etc/passwd entries starting with '+' for example.&lt;BR /&gt;&lt;BR /&gt;Also, 'passwd -f' requires a user name, as noted on the man page and usage message for passwd.&lt;BR /&gt;&lt;BR /&gt;$ echo foo | passwd -f&lt;BR /&gt;Usage:&lt;BR /&gt;        passwd [name]&lt;BR /&gt;        passwd -r files [-F files] [name]&lt;BR /&gt;        passwd -r files [-e [shell]] [-gh] [name]&lt;BR /&gt;        passwd -r files -s [-a]&lt;BR /&gt;        passwd -r files -s [name]&lt;BR /&gt;        passwd -r files [-d|-l] [-f] [-n min] [-w warn] [-x max] name&lt;BR /&gt;        passwd -r nis [-e [shell]] [-gh] [name]&lt;BR /&gt;        passwd -r dce [-e [shell]] [-gh] [name]&lt;BR /&gt;&lt;BR /&gt;Tools such as 'expect' (available at expect.nist.gov) can be helpful for such tasks.  &lt;A href="http://en.wikipedia.org/wiki/Expect" target="_blank"&gt;http://en.wikipedia.org/wiki/Expect&lt;/A&gt; has some examples of automating ftp and telnet sessions.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://rodopi.floydrussell.com/events.html" target="_blank"&gt;http://rodopi.floydrussell.com/events.html&lt;/A&gt; has a 'password script' section that shows an example of an expect script for performing such tasks.  (I know nothing of this site; it just happened to show a simple example of such a script.)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Aug 2006 18:18:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-password-in-a-script/m-p/3840793#M273272</guid>
      <dc:creator>doug hosking</dc:creator>
      <dc:date>2006-08-11T18:18:43Z</dc:date>
    </item>
  </channel>
</rss>

