<?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: Another scripting question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446423#M769563</link>
    <description>Amongst several other options are:-&lt;BR /&gt;&lt;BR /&gt;Install 'expect' so that you can control the 'passwd' command.&lt;BR /&gt;&lt;BR /&gt;Write a C program to call 'crypt' (I think not the crypt command) to encrypt the password or use a known encrypted 'initial' password that the user has to change when they first log in. If you are generating records to be appended to /etc/passwd then this encrypted string can be included in the record at that stage.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 19 Sep 2000 17:46:25 GMT</pubDate>
    <dc:creator>John Palmer</dc:creator>
    <dc:date>2000-09-19T17:46:25Z</dc:date>
    <item>
      <title>Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446421#M769561</link>
      <description>Hello all,&lt;BR /&gt;I'm putting together a script to create users (either from input or from a file).  The last hitch I've run into is how to set the password.  I have it creating the actual password, but I'm not sure how to get it into the /etc/passwd file.  I figure there are two ways, first the passwd command (in some form) and second the crypt command (which I haven't really used before).  Does anyone have any thoughts?  I could just spit the password up on the screen, have the passwd command execute and have the operator type it in twice, but this would just add the human error element to it and would slow down the processing of a list of people. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 19 Sep 2000 17:09:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446421#M769561</guid>
      <dc:creator>Steve Sauve</dc:creator>
      <dc:date>2000-09-19T17:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446422#M769562</link>
      <description>i've worked on a bunch of platforms&lt;BR /&gt;so im not sure this is true for HP-UX or not&lt;BR /&gt;but from what i've seen the passwd command is one of those that will not work in a script .... the only work around i've seen is to use an option to defer the password and have it set upon the first login attempt&lt;BR /&gt;&lt;BR /&gt;and i have never done that on HP-UX ...(was with a SCO system)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;jim</description>
      <pubDate>Tue, 19 Sep 2000 17:45:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446422#M769562</guid>
      <dc:creator>James Odak</dc:creator>
      <dc:date>2000-09-19T17:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446423#M769563</link>
      <description>Amongst several other options are:-&lt;BR /&gt;&lt;BR /&gt;Install 'expect' so that you can control the 'passwd' command.&lt;BR /&gt;&lt;BR /&gt;Write a C program to call 'crypt' (I think not the crypt command) to encrypt the password or use a known encrypted 'initial' password that the user has to change when they first log in. If you are generating records to be appended to /etc/passwd then this encrypted string can be included in the record at that stage.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Sep 2000 17:46:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446423#M769563</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2000-09-19T17:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446424#M769564</link>
      <description>&lt;BR /&gt;Theres a couple of ways to do this;&lt;BR /&gt;&lt;BR /&gt;1. Set their password in such a way as it has no password but requires the user to set their password the first time they login. Use the modprpw command.&lt;BR /&gt;&lt;BR /&gt;2. Set your own password, you now know what it is, copy the encrypted string from the password file and put it into your script. You can now write this to any new password file entries and the password is set to something you already know.</description>
      <pubDate>Tue, 19 Sep 2000 17:49:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446424#M769564</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2000-09-19T17:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446425#M769565</link>
      <description>I appreciate the responses but they don't quite do what I'm looking for.  What I need to do is create a unique password for each user.  As I said I already create the password, just need to get it encrypted into the /etc/passwd file.  &lt;BR /&gt;What is "expect"?  &lt;BR /&gt;I looked at the encrypt command, but it seems to want a key, which tells me that it won't be properly encrypted as a password.&lt;BR /&gt;Any other help would be appreciated.&lt;BR /&gt;Thanks,&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 19 Sep 2000 19:31:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446425#M769565</guid>
      <dc:creator>Steve Sauve</dc:creator>
      <dc:date>2000-09-19T19:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446426#M769566</link>
      <description>expect is another 'scripting' langauge, so is perl, awk, sed, etc.&lt;BR /&gt;expect works by "chatting" with the commands that you send. Example,&lt;BR /&gt;&lt;BR /&gt;send passwd&lt;BR /&gt;expect New Password:&lt;BR /&gt;send &lt;THE passwd=""&gt;&lt;BR /&gt;expect reenter password&lt;BR /&gt;send &lt;THE passwd=""&gt;&lt;BR /&gt;&lt;BR /&gt;You send a command, tell the script what to expect, it acknowledges, send the passwd.&lt;BR /&gt;However, in using expect the passwd you send is going to be clear. It is the passwd command that does the encrypting. &lt;BR /&gt;Very useful but not very secure with what you are doing. &lt;BR /&gt;There are some perl scripts that will do this as well.&lt;BR /&gt;&lt;BR /&gt;&lt;/THE&gt;&lt;/THE&gt;</description>
      <pubDate>Tue, 19 Sep 2000 19:43:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446426#M769566</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2000-09-19T19:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446427#M769567</link>
      <description>&lt;BR /&gt;I still believe you want the modprpw command. It accepts the format;&lt;BR /&gt;&lt;BR /&gt;modprpw -w &lt;ENCRYPTED password=""&gt; &lt;LOGON id=""&gt;&lt;BR /&gt;&lt;BR /&gt;Looks like this will enable you to set a users encrypted password to &lt;STRING&gt; where string is a know password you decide on.&lt;/STRING&gt;&lt;/LOGON&gt;&lt;/ENCRYPTED&gt;</description>
      <pubDate>Tue, 19 Sep 2000 19:50:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446427#M769567</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2000-09-19T19:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446428#M769568</link>
      <description>&lt;BR /&gt;Nope, my previous reply is no good, you need to pass the already encrypted password to it which is not what you want.&lt;BR /&gt;&lt;BR /&gt;However, ive found a link to exactly what you want, including a perl script which will do the job;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.dutchworks.nl/htbin/hpsysadmin?h=3&amp;amp;dn=44860&amp;amp;q=generating%20passwords&amp;amp;fh" target="_blank"&gt;http://www.dutchworks.nl/htbin/hpsysadmin?h=3&amp;amp;dn=44860&amp;amp;q=generating%20passwords&amp;amp;fh&lt;/A&gt;</description>
      <pubDate>Tue, 19 Sep 2000 19:58:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446428#M769568</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2000-09-19T19:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446429#M769569</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;What you are trying to do is not possible with the crypt command.&lt;BR /&gt;&lt;BR /&gt;You should use the crypt library call (crypt(3)).&lt;BR /&gt;&lt;BR /&gt;I attached a small C-program that 'crypts' the first argument on the commandline into a format to be used in the passwd file.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Rik.</description>
      <pubDate>Tue, 19 Sep 2000 20:04:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446429#M769569</guid>
      <dc:creator>RikTytgat</dc:creator>
      <dc:date>2000-09-19T20:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446430#M769570</link>
      <description>You can find expect here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://expect.nist.gov/" target="_blank"&gt;http://expect.nist.gov/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You will need to install tcl tk and expect to get expect to run.&lt;BR /&gt;&lt;BR /&gt;This is the command line to use the passwd feature of expect.&lt;BR /&gt;&lt;BR /&gt;/opt/expect/bin/expect /opt/expect/bin/autopasswd 'loginuser' 'password'&lt;BR /&gt;&lt;BR /&gt;This will set the password for the 'loginuser' to what ever 'password' is.&lt;BR /&gt;&lt;BR /&gt;This works in a shell script as this is how I stage new systems with passwords inplace.</description>
      <pubDate>Wed, 20 Sep 2000 00:10:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446430#M769570</guid>
      <dc:creator>Lawrence Mahan</dc:creator>
      <dc:date>2000-09-20T00:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Another scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446431#M769571</link>
      <description>You can find expect here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://expect.nist.gov/" target="_blank"&gt;http://expect.nist.gov/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You will need to install tcl tk and expect to get expect to run.&lt;BR /&gt;&lt;BR /&gt;This is the command line to use the passwd feature of expect.&lt;BR /&gt;&lt;BR /&gt;/opt/expect/bin/expect /opt/expect/bin/autopasswd 'loginuser' 'password'&lt;BR /&gt;&lt;BR /&gt;This will set the password for the 'loginuser' to what ever 'password' is.&lt;BR /&gt;&lt;BR /&gt;This works in a shell script as this is how I stage new systems with passwords inplace.</description>
      <pubDate>Wed, 20 Sep 2000 00:15:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-scripting-question/m-p/2446431#M769571</guid>
      <dc:creator>Lawrence Mahan</dc:creator>
      <dc:date>2000-09-20T00:15:40Z</dc:date>
    </item>
  </channel>
</rss>

