<?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: Change Password without prompting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187614#M323251</link>
    <description>There's some dependencies.  So look at those and install in order.&lt;BR /&gt;&lt;BR /&gt;You'll have to make sense of it by accessing the portal site I posted in my last link.&lt;BR /&gt;&lt;BR /&gt;For example expect requires tcltk.&lt;BR /&gt;</description>
    <pubDate>Mon, 28 Apr 2008 07:11:17 GMT</pubDate>
    <dc:creator>OFC_EDM</dc:creator>
    <dc:date>2008-04-28T07:11:17Z</dc:date>
    <item>
      <title>Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187607#M323244</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I require to change an user user password without prompting. Because I need to trigger the command from my program. Currently the linux has the following option,&lt;BR /&gt;&lt;BR /&gt;/usr/sbin/usermod -p &lt;USER name=""&gt; &lt;PASSWORD&gt;&lt;BR /&gt;&lt;BR /&gt;But the -p option is not available in hp-ux. Is there any way to change the password without prompting ?  &lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ramesh&lt;/PASSWORD&gt;&lt;/USER&gt;</description>
      <pubDate>Mon, 28 Apr 2008 06:04:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187607#M323244</guid>
      <dc:creator>J Ramesh Kumar</dc:creator>
      <dc:date>2008-04-28T06:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187608#M323245</link>
      <description>Think you're out of luck.&lt;BR /&gt;&lt;BR /&gt;Are you changing password for same user across systems?&lt;BR /&gt;&lt;BR /&gt;If so, All I can think of is to change the password on one system.&lt;BR /&gt;&lt;BR /&gt;Then from the program Copy there entry from the password file onto the other systems.  &lt;BR /&gt;&lt;BR /&gt;Provided they're using the same UID on the other systems.&lt;BR /&gt;&lt;BR /&gt;Also there may be more considerations if you're using Trusted mode etc.&lt;BR /&gt;&lt;BR /&gt;We do have a script here which does this for a select group.  I'll see if I can find it and see if there's any hints there.&lt;BR /&gt;&lt;BR /&gt;But again there is the requirment to initially answer a prompt.&lt;BR /&gt;&lt;BR /&gt;----------------------&lt;BR /&gt;There are utilities to automatically script responses to questions from commands.&lt;BR /&gt;&lt;BR /&gt;Can't think of it right now but you may be able to use on of those.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Apr 2008 06:14:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187608#M323245</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-28T06:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187609#M323246</link>
      <description>Hi Kevin,&lt;BR /&gt;&lt;BR /&gt;Thanks for the quick response. My exact requirement is, my application server will run one m/c and agent will run the hp-ux system. User can change their password from my application client. If he changes the password from the client, the server will send out the request to the agent which written in C code. The agent will trigger a command which will change the password on the hpux m/c. Please let me know, if you have any utilities for handling prompting issue. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ramesh</description>
      <pubDate>Mon, 28 Apr 2008 06:32:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187609#M323246</guid>
      <dc:creator>J Ramesh Kumar</dc:creator>
      <dc:date>2008-04-28T06:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187610#M323247</link>
      <description>I'm on it....I believe I had a script some years ago that did this.  Trying to find it for you.&lt;BR /&gt;&lt;BR /&gt;May not have it today though.&lt;BR /&gt;&lt;BR /&gt;Cheers</description>
      <pubDate>Mon, 28 Apr 2008 06:41:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187610#M323247</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-28T06:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187611#M323248</link>
      <description>Found this old script.  But it needs the product "expect" on the system.&lt;BR /&gt;&lt;BR /&gt;The con is that you have to know what your prompts will be:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# \&lt;BR /&gt;exec expect -f "$0" ${1+"$@"}&lt;BR /&gt;set password [lindex $argv 1]&lt;BR /&gt;spawn passwd [lindex $argv 0]&lt;BR /&gt;expect "assword:"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;expect "assword:"&lt;BR /&gt;send "$password\r"&lt;BR /&gt;expect eof&lt;BR /&gt;&lt;BR /&gt;Usage&lt;BR /&gt;changepasswd username 123456</description>
      <pubDate>Mon, 28 Apr 2008 06:47:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187611#M323248</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-28T06:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187612#M323249</link>
      <description>This question has been asked before in these forums.&lt;BR /&gt;&lt;BR /&gt;Here's one thread&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=598850" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=598850&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;In the Forum search use the keywords "expect passwd" and you'll get a few more hits.&lt;BR /&gt;&lt;BR /&gt;Good luck.&lt;BR /&gt;&lt;BR /&gt;(If you can post your solution once done it would benefit others...oh and points are nice too :)</description>
      <pubDate>Mon, 28 Apr 2008 06:51:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187612#M323249</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-28T06:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187613#M323250</link>
      <description>You can download the expect software for HP-UX from here.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.ece.ualberta.ca/hppd/hpux/Tcl/expect-5.43/" target="_blank"&gt;http://hpux.ece.ualberta.ca/hppd/hpux/Tcl/expect-5.43/&lt;/A&gt;</description>
      <pubDate>Mon, 28 Apr 2008 07:07:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187613#M323250</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-28T07:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187614#M323251</link>
      <description>There's some dependencies.  So look at those and install in order.&lt;BR /&gt;&lt;BR /&gt;You'll have to make sense of it by accessing the portal site I posted in my last link.&lt;BR /&gt;&lt;BR /&gt;For example expect requires tcltk.&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Apr 2008 07:11:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187614#M323251</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-04-28T07:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187615#M323252</link>
      <description>Can you generate the password first then copy to the other machines through script?&lt;BR /&gt;&lt;BR /&gt;#!/opt/perl/bin/perl&lt;BR /&gt;&lt;BR /&gt;print "Salt code: ";&lt;BR /&gt;$VAR{salt}=&amp;lt;&amp;gt;; #first argument&lt;BR /&gt;print "Password: ";&lt;BR /&gt;$VAR{pass}=&amp;lt;&amp;gt;; #second argument&lt;BR /&gt;$VAR{pass}=crypt($VAR{pass}, $VAR{salt});&lt;BR /&gt;print "Result: ", $VAR{pass}, "\n";&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Apr 2008 03:52:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187615#M323252</guid>
      <dc:creator>CharlesC</dc:creator>
      <dc:date>2008-04-29T03:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187616#M323253</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Is the salt can be anything ? If the salt code is given by user, how the system interpret the /etc/passwd file. I am planing to encrypt the password and directly write to /etc/passwd file. Here, I am struggling with the salt code.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ramesh</description>
      <pubDate>Tue, 29 Apr 2008 04:37:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187616#M323253</guid>
      <dc:creator>J Ramesh Kumar</dc:creator>
      <dc:date>2008-04-29T04:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187617#M323254</link>
      <description>If you look at the /etc/passwd file, the salt is the first 2 letters of the encrypted password.</description>
      <pubDate>Tue, 29 Apr 2008 05:08:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187617#M323254</guid>
      <dc:creator>CharlesC</dc:creator>
      <dc:date>2008-04-29T05:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187618#M323255</link>
      <description>Supposedly the salt is generated randomly by system. On the other hand, the system doesn't care what the salt is, as long as it match with the encrypt password.</description>
      <pubDate>Tue, 29 Apr 2008 05:10:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187618#M323255</guid>
      <dc:creator>CharlesC</dc:creator>
      <dc:date>2008-04-29T05:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187619#M323256</link>
      <description>Hi Kevin &amp;amp; Charles,&lt;BR /&gt;&lt;BR /&gt;Thanks for your help. Since my product will be installed in many customer places, I tried to remove the dependency with 'expect' command. So I directly change the /etc/passwd file by doing the following steps,&lt;BR /&gt;&lt;BR /&gt;    * My agent C code encrypt the password using crypt(password,salt); function. Following link contains some information about this,&lt;BR /&gt;&lt;BR /&gt;        &lt;A href="http://www.sunmanagers.org/archives/1996/0603.html" target="_blank"&gt;http://www.sunmanagers.org/archives/1996/0603.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;    * The generated encrypted password will be passed to a script. That script will directly change the /etc/passwd file with the encrypted password. Following are the content of the script which may be helpful for others,&lt;BR /&gt;&lt;BR /&gt;        #!/bin/sh&lt;BR /&gt;        echo $#&lt;BR /&gt;        if [ $# -ne 3 ]&lt;BR /&gt;        then&lt;BR /&gt;                echo "Usage : sh changePassword.sh &lt;USER&gt; &lt;OLD_ENC_PASSWD&gt; &lt;NEW_ENC_PASSWD&gt;"&lt;BR /&gt;                exit 1&lt;BR /&gt;        fi&lt;BR /&gt;        USER_NAME=$1&lt;BR /&gt;        OLD_PASSWD=$2&lt;BR /&gt;        NEW_PASSWD=$3&lt;BR /&gt;&lt;BR /&gt;        FILE_NAME='passwd'&lt;BR /&gt;        FILE_FULL_PATH='/etc/passwd'&lt;BR /&gt;&lt;BR /&gt;        if [ ! -f $FILE_NAME.orig ]&lt;BR /&gt;        then&lt;BR /&gt;            cp -f $FILE_FULL_PATH $FILE_NAME.orig&lt;BR /&gt;        fi&lt;BR /&gt;        cp -f $FILE_FULL_PATH $FILE_NAME.bkup&lt;BR /&gt;&lt;BR /&gt;        OLD_LINE=`cat $FILE_FULL_PATH | grep $USER_NAME":"$OLD_PASSWD`&lt;BR /&gt;&lt;BR /&gt;        if [ "$OLD_LINE" != "" ]&lt;BR /&gt;        then&lt;BR /&gt;                OLD_DATA=`echo $OLD_LINE | cut -d ":" -f3-10`&lt;BR /&gt;                NEW_LINE=$USER_NAME":"$NEW_PASSWD":"$OLD_DATA&lt;BR /&gt;                cat $FILE_FULL_PATH | grep -v $USER_NAME":"$OLD_PASSWD &amp;gt; $FILE_NAME.tmp&lt;BR /&gt;                echo $NEW_LINE &amp;gt;&amp;gt; $FILE_NAME.tmp&lt;BR /&gt;                cp -f $FILE_NAME.tmp $FILE_FULL_PATH&lt;BR /&gt;                chmod 644 $FILE_FULL_PATH&lt;BR /&gt;                echo "Password for "$USER_NAME" has been changed successfully at "`date`  &amp;gt;&amp;gt;chpwd.log&lt;BR /&gt;                exit 0&lt;BR /&gt;        else&lt;BR /&gt;                echo "Could not find old entry." &amp;gt;&amp;gt;chpwd.log&lt;BR /&gt;                exit 1&lt;BR /&gt;        fi&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ramesh&lt;/NEW_ENC_PASSWD&gt;&lt;/OLD_ENC_PASSWD&gt;&lt;/USER&gt;</description>
      <pubDate>Tue, 29 Apr 2008 06:20:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187619#M323256</guid>
      <dc:creator>J Ramesh Kumar</dc:creator>
      <dc:date>2008-04-29T06:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187620#M323257</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;It may not be right place to ask solaris related question. I did the same thing in solaris and it is not working. In solaris, I have modified the /etc/shadow instead of /etc/passwd. Any help ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ramesh</description>
      <pubDate>Tue, 29 Apr 2008 10:41:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187620#M323257</guid>
      <dc:creator>J Ramesh Kumar</dc:creator>
      <dc:date>2008-04-29T10:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187621#M323258</link>
      <description>The same approach working fine for solaris. Kindly ignore my previous post.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Apr 2008 11:37:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187621#M323258</guid>
      <dc:creator>J Ramesh Kumar</dc:creator>
      <dc:date>2008-04-29T11:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187622#M323259</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Finally I got a command which accepts the password as arguments. Following are the command details,&lt;BR /&gt;&lt;BR /&gt;/usr/sam/lbin/usermod.sam -p &lt;ENCRYPTEDPASSWORD&gt; &lt;LOGINNAME&gt;&lt;BR /&gt;&lt;BR /&gt;/usr/sam/lbin/usermod.sam -p "xyZz5eiXOP3r." rameshj&lt;BR /&gt;&lt;BR /&gt;Is there any issue on the above command ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ramesh&lt;/LOGINNAME&gt;&lt;/ENCRYPTEDPASSWORD&gt;</description>
      <pubDate>Mon, 05 May 2008 08:15:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187622#M323259</guid>
      <dc:creator>J Ramesh Kumar</dc:creator>
      <dc:date>2008-05-05T08:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187623#M323260</link>
      <description>hi Ramesh,&lt;BR /&gt;&lt;BR /&gt;In Hp-UX, unfortunately we only have:&lt;BR /&gt; usermod [-u uid [-o]] [-g group] [-G group [, group...]]&lt;BR /&gt;      [-d dir [-m]] [-s shell] [-c comment] [-f inactive]&lt;BR /&gt;      [-l new_logname] [-e expire]  login&lt;BR /&gt;&lt;BR /&gt;unline linux, solaris etc&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps too!&lt;BR /&gt;kind regards &lt;BR /&gt;yogeeraj</description>
      <pubDate>Mon, 05 May 2008 08:29:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187623#M323260</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2008-05-05T08:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187624#M323261</link>
      <description>Hi again,&lt;BR /&gt;&lt;BR /&gt;sorry for the confusion in my previous post.&lt;BR /&gt;&lt;BR /&gt;the -p option do exist when using usermod.sam&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SRV2:&amp;gt;/usr/sam/lbin/usermod.sam&lt;BR /&gt;User name must be specified&lt;BR /&gt;Usage: usermod.sam -p &lt;PASSWD&gt; -u &lt;UID&gt; -o -g &lt;GROUP&gt; -G &lt;GROUP&gt;,&lt;GROUP...&gt; -d &lt;DIR&gt; -m -s &lt;SHELL&gt; -c  -f &amp;amp;lt;inactive&amp;amp;gt; -e &amp;amp;lt;expire&amp;amp;gt; -l &amp;amp;lt;new logname&amp;amp;gt; &amp;amp;lt;login&amp;amp;gt;   &amp;amp;lt;BR /&amp;amp;gt;&amp;amp;lt;BR /&amp;amp;gt;&amp;amp;gt;Is there any issue on the above command?&amp;amp;lt;BR /&amp;amp;gt;Only when using the command over unsecured connections and possibilities of evesdropping also exists.&amp;amp;lt;BR /&amp;amp;gt;&amp;amp;lt;BR /&amp;amp;gt;There may also be the possibility of changes in the program (usermod.sam) over the next versions or patches.&amp;amp;lt;BR /&amp;amp;gt;&amp;amp;lt;BR /&amp;amp;gt;&amp;amp;lt;BR /&amp;amp;gt;kind regards&amp;amp;lt;BR /&amp;amp;gt;yogeeraj&amp;amp;lt;BR /&amp;amp;gt;&amp;amp;lt;BR /&amp;amp;gt;&amp;amp;lt;BR /&amp;amp;gt;&amp;amp;lt;BR /&amp;amp;gt;&amp;amp;lt;BR /&amp;amp;gt;&lt;/SHELL&gt;&lt;/DIR&gt;&lt;/GROUP...&gt;&lt;/GROUP&gt;&lt;/GROUP&gt;&lt;/UID&gt;&lt;/PASSWD&gt;</description>
      <pubDate>Mon, 05 May 2008 08:52:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187624#M323261</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2008-05-05T08:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187625#M323262</link>
      <description>Because your code must run on several different machines and revisions, only the usermod solution will work. Otherwise, you will have to accommodate standard, Enhanced, Trusted, and shadow authentication on the different systems. Also consider that on some systems, passwords longer than 8 characters are allowed and perhaps may be required due to company standards. The -p option only exists in /usr/sam/lbin/usermod.sam but most important: the -p value must be the encrypted password, NOT what the user typed in. &lt;BR /&gt; &lt;BR /&gt;The attached program will generate the encrypted password up to 8 characters long. Passwords longer than 8 characters are undefined. usermod.sam will immediately expire a new password if there is no aging provided so use passwd -o and -n to set the aging, or modprpw -v to refresh the aging.</description>
      <pubDate>Mon, 05 May 2008 09:39:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187625#M323262</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-05-05T09:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change Password without prompting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187626#M323263</link>
      <description>SAMMOD=/usr/sam/lbin/usermod.sam&lt;BR /&gt;  MAKEKEY=/usr/lbin/makekey&lt;BR /&gt;&lt;BR /&gt;  read cpypwd?"enter your password again for verification: "&lt;BR /&gt;  if [[ $cpypwd != $mypwd ]]; then&lt;BR /&gt;     echo&lt;BR /&gt;     echo "You have a lousy memory or you cannot type or both, try again"&lt;BR /&gt;  else&lt;BR /&gt;     break&lt;BR /&gt;  fi&lt;BR /&gt;done&lt;BR /&gt;#. $mypwd needs to be 8 characters long&lt;BR /&gt;#. 10 &amp;lt;= $seed &amp;lt;= 23+59+10  (92)&lt;BR /&gt;#. so you are supplying a 2 character SEED&lt;BR /&gt;#. This gives you a 13 character encrpted pw&lt;BR /&gt;  ((seed=`date +%H+%M+10`))&lt;BR /&gt;  echo "${mypwd}"${seed}|$MAKEKEY|read cryptpw&lt;BR /&gt;  echo "We will use pw=[${mypwd}] aka $cryptpw  for $loginid" &amp;gt;&amp;amp;2&lt;BR /&gt;  rstat=`ssh $server "$SAMMOD -F -p $cryptpw $loginid; echo $?" 2&amp;gt;/dev/null`&lt;BR /&gt;  if [[ $rstat -ne 0 ]]; then&lt;BR /&gt;     echo "Password initialization failed for $loginid" &amp;gt;&amp;amp;2&lt;BR /&gt;  fi&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Oct 2008 23:07:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-password-without-prompting/m-p/4187626#M323263</guid>
      <dc:creator>William Earley</dc:creator>
      <dc:date>2008-10-31T23:07:00Z</dc:date>
    </item>
  </channel>
</rss>

