<?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: password script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156530#M158554</link>
    <description>You can use epect utility for this.&lt;BR /&gt;&lt;BR /&gt;Aother crude method is as follows.&lt;BR /&gt;&lt;BR /&gt;Prepare a list of uses in a file.&lt;BR /&gt;&lt;BR /&gt;You can use usermod.sam command for this.&lt;BR /&gt;&lt;BR /&gt;/usr/sam/lbin/usermod.sam -p "`echo "user_name"`|makekey" user_name.&lt;BR /&gt;&lt;BR /&gt;Use this command in script and you should be done.</description>
    <pubDate>Mon, 05 Jan 2004 14:55:10 GMT</pubDate>
    <dc:creator>RAC_1</dc:creator>
    <dc:date>2004-01-05T14:55:10Z</dc:date>
    <item>
      <title>password script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156528#M158552</link>
      <description>I have 30 new users that I would like to set the same initial password for. I would like to accomplish this through a script. This script would contain the initial passwd and then force a change upon first login. I am not sure how to deal with the interactive prompt for password that the command passwd displays.</description>
      <pubDate>Mon, 05 Jan 2004 14:50:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156528#M158552</guid>
      <dc:creator>John Carver</dc:creator>
      <dc:date>2004-01-05T14:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: password script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156529#M158553</link>
      <description>The default standard for such a situation is to write an expect script. I played around with it before and it's very neat.&lt;BR /&gt;I'm not sure where to get it from, but do a search on "expect" in the forums and you'll find a lot of information about it.&lt;BR /&gt;&lt;BR /&gt;-Hazem</description>
      <pubDate>Mon, 05 Jan 2004 14:53:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156529#M158553</guid>
      <dc:creator>Hazem Mahmoud_3</dc:creator>
      <dc:date>2004-01-05T14:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: password script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156530#M158554</link>
      <description>You can use epect utility for this.&lt;BR /&gt;&lt;BR /&gt;Aother crude method is as follows.&lt;BR /&gt;&lt;BR /&gt;Prepare a list of uses in a file.&lt;BR /&gt;&lt;BR /&gt;You can use usermod.sam command for this.&lt;BR /&gt;&lt;BR /&gt;/usr/sam/lbin/usermod.sam -p "`echo "user_name"`|makekey" user_name.&lt;BR /&gt;&lt;BR /&gt;Use this command in script and you should be done.</description>
      <pubDate>Mon, 05 Jan 2004 14:55:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156530#M158554</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-01-05T14:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: password script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156531#M158555</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;You can download the Expect program from:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.38/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.38/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You can find an example of automating passwd in "Unix Power Tools" book.&lt;BR /&gt;&lt;BR /&gt;Elena.</description>
      <pubDate>Mon, 05 Jan 2004 17:14:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156531#M158555</guid>
      <dc:creator>Elena Leontieva</dc:creator>
      <dc:date>2004-01-05T17:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: password script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156532#M158556</link>
      <description>Something like this would work&lt;BR /&gt;&lt;BR /&gt;-------------&lt;BR /&gt;#!/usr/bin/expect -f&lt;BR /&gt;set pass [lindex $argv 2]&lt;BR /&gt;spawn [lindex $argv 0] [lindex $argv 1] &lt;BR /&gt;expect password:&lt;BR /&gt;send "$pass\r"    &lt;BR /&gt;expect password:  &lt;BR /&gt;send "$pass\r"&lt;BR /&gt;expect eof&lt;BR /&gt;---------------&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jan 2004 17:20:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156532#M158556</guid>
      <dc:creator>Paddy_1</dc:creator>
      <dc:date>2004-01-05T17:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: password script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156533#M158557</link>
      <description>RAC,&lt;BR /&gt;&lt;BR /&gt;For some reason the script you gave isn't working for me.  Could you elaborate more on what this script does?</description>
      <pubDate>Wed, 15 Jun 2005 17:13:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156533#M158557</guid>
      <dc:creator>Patrick Ware_1</dc:creator>
      <dc:date>2005-06-15T17:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: password script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156534#M158558</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;If this is the only time you have to do something like this, you might consider using /usr/sam/lbin/usermod -p ${pwd} ${user} or /usr/sam/lbin/useradd -p ${pwd} ... ${user}&lt;BR /&gt;&lt;BR /&gt;The -p options on these commands allows you to supply an encrypted password.  Either add one of them or change the password of an existing user, then just copy the password into the X11 clipboard.  Once done, you can loop through all the users by:&lt;BR /&gt;&lt;BR /&gt;for user in $(cat ${user_file})&lt;BR /&gt;do&lt;BR /&gt;/usr/sam/lbin/usermod -p `middle_mouse_button_to_paste' ${user}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;As far as the expect, it's very useful.  I think the syntax is horrendous though so I use the expect modules with perl.  great combination!&lt;BR /&gt;&lt;BR /&gt;In this case, though, assuming you don't need it for anything else, it may be akin to slaying a fly with a small thermonuclear device.&lt;BR /&gt;&lt;BR /&gt;HTH;&lt;BR /&gt;&lt;BR /&gt;Doug&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Jun 2005 22:25:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/password-script/m-p/3156534#M158558</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2005-06-15T22:25:31Z</dc:date>
    </item>
  </channel>
</rss>

