<?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: Script for changing root passwd in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404080#M201441</link>
    <description>Marcia, Sorry please ignore my last message !! &lt;BR /&gt;&lt;BR /&gt;This will work&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;NEW_PASS=$(cat /tmp/pas)&lt;BR /&gt;awk -F: -v PASS=$NEW_PASS '{if ($1 == "root") {OFS=":";$2=PASS;print} else print }' /etc/passwd.save &amp;gt; /etc/passwd</description>
    <pubDate>Wed, 20 Oct 2004 08:48:21 GMT</pubDate>
    <dc:creator>Sundar_7</dc:creator>
    <dc:date>2004-10-20T08:48:21Z</dc:date>
    <item>
      <title>Script for changing root passwd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404075#M201436</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;I'm trying to change root passwd (I have many HP servers), using vipw:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;export NEW=$(cat /tmp/pas)     #this file contains a crypt passwd&lt;BR /&gt;vipw &amp;lt;&amp;lt; EOF&lt;BR /&gt;/^root:&lt;BR /&gt;f:lct:$NEW^[x!&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;the problem is when I execute this script - error message: Input read error ...&lt;BR /&gt;&lt;BR /&gt;any hints ?&lt;BR /&gt;&lt;BR /&gt;rgs&lt;BR /&gt;Marcia Ferreira&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Oct 2004 08:13:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404075#M201436</guid>
      <dc:creator>Marcia Ferreira_5</dc:creator>
      <dc:date>2004-10-20T08:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script for changing root passwd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404076#M201437</link>
      <description>The problem is that vipw (vi, etc.) is interactive and not designed to run in a script.&lt;BR /&gt;&lt;BR /&gt;Try usermod.sam instead.&lt;BR /&gt;# /usr/sam/lbin/usermod.sam -F -p encrypted_passwd root&lt;BR /&gt;&lt;BR /&gt;Personally I think changing root password from a script is a dangerous thing to do.</description>
      <pubDate>Wed, 20 Oct 2004 08:30:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404076#M201437</guid>
      <dc:creator>Cheryl Griffin</dc:creator>
      <dc:date>2004-10-20T08:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script for changing root passwd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404077#M201438</link>
      <description>seems vipw or like vi reads from tty device in screen mode which might be un-cooked or RAW.&lt;BR /&gt;&lt;BR /&gt;I know you can use ":" for ex(1) mode within&lt;BR /&gt;vi or vipw.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;might want to test this script out using something other than root login.&lt;BR /&gt;&lt;BR /&gt;best of luck</description>
      <pubDate>Wed, 20 Oct 2004 08:31:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404077#M201438</guid>
      <dc:creator>D Block 2</dc:creator>
      <dc:date>2004-10-20T08:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Script for changing root passwd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404078#M201439</link>
      <description>You will not be able to do it with vi/vipw.&lt;BR /&gt;&lt;BR /&gt;As told you have option of using&lt;BR /&gt;/usr/sam/lbin/sam.usermod -p "ebcrypted_pass" root&lt;BR /&gt;&lt;BR /&gt;echo "anil1234te"|/usr/lbin/makekey Will give you the encrypted password. the first 8 chars is a password and last two chars are salt.&lt;BR /&gt;&lt;BR /&gt;The other option is to use expect. Get it here.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk" target="_blank"&gt;http://hpux.connect.org.uk&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Wed, 20 Oct 2004 08:42:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404078#M201439</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-10-20T08:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script for changing root passwd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404079#M201440</link>
      <description>vipw is meant to be an interactive stream-based editor.&lt;BR /&gt;&lt;BR /&gt;if I can guess it right, it is nothing more than a wrapper to vi, with some additional code for lock/temp file creation, etc.&lt;BR /&gt;&lt;BR /&gt;If you already have the encrypted password, you can try something like this&lt;BR /&gt;&lt;BR /&gt;#!/usr/sbin/sh&lt;BR /&gt;NEW_PASS=$(cat /tmp/pas)&lt;BR /&gt;cp /etc/passwd /etc/passwd.save&lt;BR /&gt;awk -F: -v PASS=$NEW_PASS '$1 ~ /root/ {OFS=":";$2=PASS; print}' /etc/passwd.save &amp;gt; /etc/passwd&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Oct 2004 08:42:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404079#M201440</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-10-20T08:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Script for changing root passwd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404080#M201441</link>
      <description>Marcia, Sorry please ignore my last message !! &lt;BR /&gt;&lt;BR /&gt;This will work&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;NEW_PASS=$(cat /tmp/pas)&lt;BR /&gt;awk -F: -v PASS=$NEW_PASS '{if ($1 == "root") {OFS=":";$2=PASS;print} else print }' /etc/passwd.save &amp;gt; /etc/passwd</description>
      <pubDate>Wed, 20 Oct 2004 08:48:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-changing-root-passwd/m-p/3404080#M201441</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-10-20T08:48:21Z</dc:date>
    </item>
  </channel>
</rss>

