<?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: modprpw - with SUPPLIED password in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867888#M97712</link>
    <description>cat userinfo |while read line&lt;BR /&gt;do&lt;BR /&gt;USER=$(echo $line|awk '{FS=":";print $1}')&lt;BR /&gt;PASS=$(echo $line|awk '{FS=":";print $2}')&lt;BR /&gt;/usr/sam/lbin/usermod.sam -p`echo "$PASS"` $USER&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;userinfo file would look like:&lt;BR /&gt;user1:password1&lt;BR /&gt;user2:password2&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.</description>
    <pubDate>Thu, 19 Dec 2002 16:58:03 GMT</pubDate>
    <dc:creator>Paul Sperry</dc:creator>
    <dc:date>2002-12-19T16:58:03Z</dc:date>
    <item>
      <title>modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867887#M97711</link>
      <description>Hey Gang, &lt;BR /&gt;&lt;BR /&gt;I am trying to find a way (anyway really) to automatically change user account passwords to a specific password.&lt;BR /&gt;&lt;BR /&gt;We have been using "modprpw -x" to expire an accounts password and assign a new RANDOM password.  Ideally, I would love to find a way to use "modprpw" to change the password, however have the password changed to a SUPPLIED password.&lt;BR /&gt;&lt;BR /&gt;I am willing to change and re-compile c code if necessary (I.E.  encrypt.c, or use rsa.h, or whatever.)&lt;BR /&gt;&lt;BR /&gt;It WILL NOT work to have the password changed to random and the user change the password when he/she logs in.  These are accounts used by multiple people and (thus the rub) they are NOT allowed to change it (which is why we need to supply a password and have it automatically changed.)&lt;BR /&gt;&lt;BR /&gt;There are a number of accounts, so changing the password manually would be a poor solution.&lt;BR /&gt;&lt;BR /&gt;HELP!  and thanks as always!&lt;BR /&gt;&lt;BR /&gt;Mike&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Dec 2002 16:34:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867887#M97711</guid>
      <dc:creator>Mike_316</dc:creator>
      <dc:date>2002-12-19T16:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867888#M97712</link>
      <description>cat userinfo |while read line&lt;BR /&gt;do&lt;BR /&gt;USER=$(echo $line|awk '{FS=":";print $1}')&lt;BR /&gt;PASS=$(echo $line|awk '{FS=":";print $2}')&lt;BR /&gt;/usr/sam/lbin/usermod.sam -p`echo "$PASS"` $USER&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;userinfo file would look like:&lt;BR /&gt;user1:password1&lt;BR /&gt;user2:password2&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.</description>
      <pubDate>Thu, 19 Dec 2002 16:58:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867888#M97712</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2002-12-19T16:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867889#M97713</link>
      <description>Hey!  &lt;BR /&gt;&lt;BR /&gt;Thanks for the info.  Running into a snag however.  We are using RSA on this box.  Therefore, when I run the "/usr/sam/lbin/usermod.sam -p" command, it DOES change the password in the "/tcb/files/auth/&lt;LETTER&gt;/&lt;USERNAME&gt;" file...however the account cannot log in.&lt;BR /&gt;&lt;BR /&gt;What appears to be happening is, when I use the "/usr/sam/lbin/usermod.sam -p" command, it appears to enter whatever I give it as the password parameter into the "/tcb/files/auth/&lt;LETTER&gt;/&lt;USERNAME&gt;" file verbatim...however if I use the "passwd &lt;USERNAME&gt;" command (with the same password) and then check the "/tcb/files/auth/&lt;LETTER&gt;/&lt;USERNAME&gt;" file, it has what appears to be the encrypted version of the password entered there.  &lt;BR /&gt;&lt;BR /&gt;I am thinking I need to encrypt the password (according to the requirements of RSA and HPUX 11) and then offer the encrypted version of the password to the "/usr/sam/lbin/usermod.sam -p" command.&lt;BR /&gt;&lt;BR /&gt;Does anyone know how to do this??&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;Mike&lt;BR /&gt;&lt;/USERNAME&gt;&lt;/LETTER&gt;&lt;/USERNAME&gt;&lt;/USERNAME&gt;&lt;/LETTER&gt;&lt;/USERNAME&gt;&lt;/LETTER&gt;</description>
      <pubDate>Thu, 19 Dec 2002 19:16:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867889#M97713</guid>
      <dc:creator>Mike_316</dc:creator>
      <dc:date>2002-12-19T19:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867890#M97714</link>
      <description>Yes mike when you use /usr/sam/lbin/usermod.sam -p &lt;PASSWD&gt; username&lt;BR /&gt;It puts the same passwd(without encryption) into /tcb/files/auth/...username.&lt;BR /&gt;To get rid of this use a c program and by using crypt library you can encrypt the password and then use that in conjunction with usermod.sam.&lt;BR /&gt;It will definately work.&lt;BR /&gt;Let me know if you want that C program...I have written one.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Rajeev&lt;/PASSWD&gt;</description>
      <pubDate>Thu, 19 Dec 2002 23:18:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867890#M97714</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-19T23:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867891#M97715</link>
      <description>Hey Rajeev, &lt;BR /&gt;&lt;BR /&gt;Thanks for the confirmation!  I woudl DEFINITELY like that C program.  I have been looking all over for one, and cannot find one which will do the job.&lt;BR /&gt;&lt;BR /&gt;Can you just list the code here, on the forum?  I should be able to cut, paste and can compile it on my machine.&lt;BR /&gt;&lt;BR /&gt;Thanks!  I greatly appreciate it!!&lt;BR /&gt;Mike&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Dec 2002 23:51:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867891#M97715</guid>
      <dc:creator>Mike_316</dc:creator>
      <dc:date>2002-12-19T23:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867892#M97716</link>
      <description>Yes mike,&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;CRYPT.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;char *pass;&lt;BR /&gt;char *s = "JQ";&lt;BR /&gt;char *p = "hello123"; /* The password to be set */&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;/* p = getpass();  Uncomment this line if you want password to be asked */&lt;BR /&gt;pass = crypt(p,s); &lt;BR /&gt;printf("%s\n", pass);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;This is the program when you compile it and run it gives you an encrypted password which you can either paste in /tcb...or you can use /usr/sam/lbin/usermod.sam -p &lt;OUTPUT of="" above="" program=""&gt; username.&lt;BR /&gt;&lt;BR /&gt;Note this sets the password to "hello123" but if you want to provide the password uncomment the "getpass()" line. and when u run the program it will ask you to privide password which is not echoed and then after u press enter it give you the encrypted password.&lt;BR /&gt;&lt;BR /&gt;Let me know how it goes.&lt;BR /&gt;&lt;BR /&gt;Rajeev&lt;/OUTPUT&gt;&lt;/UNISTD.H&gt;&lt;/CRYPT.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 20 Dec 2002 00:06:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867892#M97716</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-20T00:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867893#M97717</link>
      <description>Thanks Rajeev !!&lt;BR /&gt;&lt;BR /&gt;It compiled easily. I do have one additional question, not really being a C programmer.  How would I change the code to allow the unencrypted password to be passed to the compiled encryption program.  &lt;BR /&gt;&lt;BR /&gt;Basically, I will be writing a fully automated script which will pull a non-encrypted password out of a file, pass it to the encryption program, take the encrypted return and change the password for the account using the usermod.sam command.&lt;BR /&gt;&lt;BR /&gt;Thanks again!  This has been a lifesaver!&lt;BR /&gt;&lt;BR /&gt;Mike&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Dec 2002 00:16:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867893#M97717</guid>
      <dc:creator>Mike_316</dc:creator>
      <dc:date>2002-12-20T00:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867894#M97718</link>
      <description>P.S.  When I uncomment the getpass line I get a "too few arguments for ." error. ???&lt;BR /&gt;&lt;BR /&gt;Like I said, not really a C programmer.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;Mike&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Dec 2002 00:23:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867894#M97718</guid>
      <dc:creator>Mike_316</dc:creator>
      <dc:date>2002-12-20T00:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867895#M97719</link>
      <description>Here's a simple C program that uses the command line for input and produces the encrypted password with a random seed (first 2 chars):&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;TIME.H&gt;&lt;BR /&gt;&lt;BR /&gt;         /* 1st param is the desired password  */&lt;BR /&gt;         /* A random seed (2 chars) will be    */&lt;BR /&gt;         /* automatically chosen.              */&lt;BR /&gt;         /* For good passwords:                */&lt;BR /&gt;         /*     Use random chars, mixed apha-  */&lt;BR /&gt;         /*     numerics and MiXeD CaSe for    */&lt;BR /&gt;         /*     better protection.             */&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;main(argc, argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;  char salt[3];&lt;BR /&gt;  char *EncryptedPasswd;&lt;BR /&gt;  int CheckRand;&lt;BR /&gt;  int Fixup;&lt;BR /&gt;  int SeedChar;&lt;BR /&gt;&lt;BR /&gt;  printf("\nUsage: pw  &lt;PASSWORD_TO_ENCRYPT&gt;\n\n");&lt;BR /&gt;&lt;BR /&gt;/* Generate a random starting point for seed charcaters */&lt;BR /&gt;&lt;BR /&gt;  srand(time(NULL));&lt;BR /&gt;  for ( SeedChar = 0; SeedChar &amp;lt;= 1; SeedChar++) {&lt;BR /&gt;      CheckRand = 46 + rand() % 76;   /* random number from 46 to 122  */&lt;BR /&gt;      Fixup = 7 + rand() % 13;          /* random number from 7 to 20    */&lt;BR /&gt;      salt[SeedChar] = toascii(((CheckRand &amp;gt;= 58 &amp;amp;&amp;amp; CheckRand &amp;lt;= 64) ||&lt;BR /&gt;        (CheckRand &amp;gt;= 91 &amp;amp;&amp;amp; CheckRand &amp;lt;= 96) ? CheckRand + Fixup : CheckRand));&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  EncryptedPasswd=crypt(argv[1], salt);    &lt;BR /&gt;  printf("\nRequested pw= %s, Automatic Seed= %s, encrypted pw= %s\n", &lt;BR /&gt;          argv[1], salt, EncryptedPasswd);&lt;BR /&gt;}&lt;/PASSWORD_TO_ENCRYPT&gt;&lt;/TIME.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 20 Dec 2002 01:25:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867895#M97719</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2002-12-20T01:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867896#M97720</link>
      <description>Hi mike,&lt;BR /&gt;Sorry for the delay, i went out for friday lunch.&lt;BR /&gt;Here is what you probably want. Try this it should definately compile and work.&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;                                 &lt;BR /&gt;#include &lt;CRYPT.H&gt;                                 &lt;BR /&gt;#include &lt;UNISTD.H&gt;                                &lt;BR /&gt;char *pass;                                        &lt;BR /&gt;char *s = "JQ";                                    &lt;BR /&gt;char *p = "hello123"; /* The password to be set */ &lt;BR /&gt;main()                                             &lt;BR /&gt;{                                                  &lt;BR /&gt;p = getpass(); /* Uncomment this line if you want */&lt;BR /&gt;pass = crypt(p,s);                                 &lt;BR /&gt;printf("%s\n", pass);                              &lt;BR /&gt;encrypt(pass,s);                                   &lt;BR /&gt;}&lt;/UNISTD.H&gt;&lt;/CRYPT.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 20 Dec 2002 04:38:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867896#M97720</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-20T04:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867897#M97721</link>
      <description>Hey mike have you got your problem fixed, or still got some queries.&lt;BR /&gt;Please assign points if the problem is soved to people you spent their valuable time for you.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Rajeev</description>
      <pubDate>Fri, 20 Dec 2002 22:50:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867897#M97721</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-20T22:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: modprpw - with SUPPLIED password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867898#M97722</link>
      <description>Hey Guys!&lt;BR /&gt;&lt;BR /&gt;The stinker works like a charm!!  Thanks!  I used the longer version of the encrypt.c, only for the random seeding.  I managed to incorporate it beautifully into a series of scripts that keep the security high, and allows for a huge "password seeding" file.&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;&lt;BR /&gt;Mike&lt;BR /&gt;</description>
      <pubDate>Sat, 21 Dec 2002 02:16:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modprpw-with-supplied-password/m-p/2867898#M97722</guid>
      <dc:creator>Mike_316</dc:creator>
      <dc:date>2002-12-21T02:16:25Z</dc:date>
    </item>
  </channel>
</rss>

