<?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: How to change passwd with in the scrip with out asking in the terminal in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106992#M731041</link>
    <description>in shell script</description>
    <pubDate>Sat, 24 Nov 2007 02:58:43 GMT</pubDate>
    <dc:creator>chakribobby</dc:creator>
    <dc:date>2007-11-24T02:58:43Z</dc:date>
    <item>
      <title>How to change passwd with in the scrip with out asking in the terminal</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106987#M731036</link>
      <description>Hi&lt;BR /&gt;I need to change the  password for the user with in the scrip(with in the scrip i have given the password)&lt;BR /&gt;While running that scrip it should  not ask for password &lt;BR /&gt;That scrip is run by root&lt;BR /&gt;Thanks in advance&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Nov 2007 10:19:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106987#M731036</guid>
      <dc:creator>chakribobby</dc:creator>
      <dc:date>2007-11-23T10:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to change passwd with in the scrip with out asking in the terminal</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106988#M731037</link>
      <description>Hi,&lt;BR /&gt;please, can you post your original script used to given teh passwords?&lt;BR /&gt;This may help in fix your problem.&lt;BR /&gt;Rgds,&lt;BR /&gt;Art</description>
      <pubDate>Fri, 23 Nov 2007 11:07:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106988#M731037</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2007-11-23T11:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to change passwd with in the scrip with out asking in the terminal</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106989#M731038</link>
      <description>thanks for you reply &lt;BR /&gt;here i am giving you the snap shot &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;New_passwd=xzy          #is the new password&lt;BR /&gt;passwd  user &lt;BR /&gt;&lt;BR /&gt;with in the scrip If we use above command it will ask for passwd in the terminal when we run that script &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;New_passwd=xzy          #is the new password&lt;BR /&gt;passwd  user &amp;lt;  New_passwd&lt;BR /&gt;&lt;BR /&gt;what I need is it should not ask for password when I run it &lt;BR /&gt;</description>
      <pubDate>Fri, 23 Nov 2007 11:15:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106989#M731038</guid>
      <dc:creator>chakribobby</dc:creator>
      <dc:date>2007-11-23T11:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to change passwd with in the scrip with out asking in the terminal</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106990#M731039</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Check this:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.circlingcycle.com.au/Unix-sources/add-batch-Unix-accounts.pl.txt" target="_blank"&gt;http://www.circlingcycle.com.au/Unix-sources/add-batch-Unix-accounts.pl.txt&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You will easily see commands you can use to change user's password in HPUX, Solaris, AIX, Linux, and Tru64 in a script :)&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;VK2COT</description>
      <pubDate>Fri, 23 Nov 2007 21:09:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106990#M731039</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2007-11-23T21:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to change passwd with in the scrip with out asking in the terminal</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106991#M731040</link>
      <description>Thanks for you reply &lt;BR /&gt;It is more complex&lt;BR /&gt;Can you given me a small example&lt;BR /&gt;</description>
      <pubDate>Sat, 24 Nov 2007 02:56:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106991#M731040</guid>
      <dc:creator>chakribobby</dc:creator>
      <dc:date>2007-11-24T02:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to change passwd with in the scrip with out asking in the terminal</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106992#M731041</link>
      <description>in shell script</description>
      <pubDate>Sat, 24 Nov 2007 02:58:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106992#M731041</guid>
      <dc:creator>chakribobby</dc:creator>
      <dc:date>2007-11-24T02:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to change passwd with in the scrip with out asking in the terminal</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106993#M731042</link>
      <description>It is one-liner:&lt;BR /&gt;&lt;BR /&gt;/usr/sam/lbin/usermod.sam -p passwordhash &lt;BR /&gt;&lt;BR /&gt;Your problem is how to find out the&lt;BR /&gt;passwordhash. It is the encrypted password&lt;BR /&gt;string (the one you see in /etc/passwd or&lt;BR /&gt;/etc/shadow...)&lt;BR /&gt;&lt;BR /&gt;Normally, you would have to use some kind&lt;BR /&gt;of random password generators. That is&lt;BR /&gt;where Perl and Expect scripts, and other tools come handy.&lt;BR /&gt;&lt;BR /&gt;If you already have a good passwordhash&lt;BR /&gt;string, then you are OK.&lt;BR /&gt;&lt;BR /&gt;The alternative is to use GNU useradd with&lt;BR /&gt;flag "-p":&lt;BR /&gt;&lt;BR /&gt;You get an already-encrypted passwd, and use &lt;BR /&gt;the -p &lt;CRYPT&gt; option, along with &lt;BR /&gt;the other options can automate this process:&lt;BR /&gt;&lt;BR /&gt;useradd -d /home/user1 -g users -m -k -p passwordhash -s /bin/ksh&lt;BR /&gt;&lt;BR /&gt;So, in the end, simple lines for your script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;PATH=/usr/sbin:/sbin:/bin:/usr/sam/lbin; export PATH&lt;BR /&gt;&lt;BR /&gt;MYSALT="somestring"&lt;BR /&gt;MYPASS="whateverpassword"&lt;BR /&gt;&lt;BR /&gt;MYENCPASS=`perl -e 'print crypt("mypassword", "salt"),"\n"'`&lt;BR /&gt;&lt;BR /&gt;usermod.sam -p $MYENCPASS username&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;It is a trivial exercise to add more features&lt;BR /&gt;in the script (like error checking, or adding support for command-line arguiments).&lt;BR /&gt;&lt;BR /&gt;Please do not forget to assign points if you find any advice in ITRC forums useful.&lt;BR /&gt; &lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;VK2COT&lt;/CRYPT&gt;</description>
      <pubDate>Sun, 25 Nov 2007 17:44:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-change-passwd-with-in-the-scrip-with-out-asking-in-the/m-p/4106993#M731042</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2007-11-25T17:44:36Z</dc:date>
    </item>
  </channel>
</rss>

