<?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: Making a useradd script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234277#M329062</link>
    <description>awk -F: '{print $1, $2, $3, $4, $5, $6, $7}' /tmp/user | while read user pwd uid gid gecos home shell&lt;BR /&gt;do&lt;BR /&gt;useradd -u ${uid} -g ${gid} -c "${gecos}" -d ${home} -m -s ${shell} ${user}&lt;BR /&gt;done&lt;BR /&gt;</description>
    <pubDate>Wed, 16 Jul 2008 00:43:12 GMT</pubDate>
    <dc:creator>Mark Trux</dc:creator>
    <dc:date>2008-07-16T00:43:12Z</dc:date>
    <item>
      <title>Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234272#M329057</link>
      <description>First of all thanks to you all, this is my first post, but I've read good info in other ones.&lt;BR /&gt;My system is a 11.11 and I'm trying to make a script so giving a username it makes the useradd with a specified home. &lt;BR /&gt;Making this once may not be worth a script but I have 4 other machines with local autentication, and my next step is to trigger via ssh the changes on the main one.&lt;BR /&gt;&lt;BR /&gt;I've seen I can use useradd.sam to pass a password but it seems to be taken as a preencripted MD5 one. &lt;BR /&gt;&lt;BR /&gt;My script would do something like this :&lt;BR /&gt;&lt;BR /&gt;PASSWORD = Encrypt (username)&lt;BR /&gt;useradd.sam -p PASSWORD username&lt;BR /&gt;&lt;BR /&gt;(I want username = password)&lt;BR /&gt;&lt;BR /&gt;I didn't find anyone who tried user creation with scripts but this is important for my workaround. (if there is any easier way tell please)&lt;BR /&gt;&lt;BR /&gt;Excuse my english, thanks in advance.</description>
      <pubDate>Tue, 15 Jul 2008 14:55:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234272#M329057</guid>
      <dc:creator>Lluis Clemente</dc:creator>
      <dc:date>2008-07-15T14:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234273#M329058</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;You might wish to go with a LDAP or NIS based authentication system to let one computer handle authentication on all.&lt;BR /&gt;&lt;BR /&gt;Don't use useradd.sam&lt;BR /&gt;&lt;BR /&gt;User useradd directly in your script, make sure the default user configuration is in /etc/skel so the user looks good.&lt;BR /&gt;&lt;BR /&gt;Add customization for NFS and other oddities.&lt;BR /&gt;&lt;BR /&gt;(I want username = password)&lt;BR /&gt;Bad idea, violates common sense and will be used against you on the next security audit.&lt;BR /&gt;&lt;BR /&gt;Set a policy and have a password that expires in 7 days (Build that into your script).&lt;BR /&gt;&lt;BR /&gt;Or Empty the password and use the passwd command to force new password at first login&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 15 Jul 2008 15:39:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234273#M329058</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2008-07-15T15:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234274#M329059</link>
      <description>&amp;gt; useradd.sam -p &lt;BR /&gt; &lt;BR /&gt;Yes, this requires the encrypted password. The attached script will return the encrypted password suitable for useradd.sam -p.</description>
      <pubDate>Tue, 15 Jul 2008 18:18:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234274#M329059</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-07-15T18:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234275#M329060</link>
      <description>&lt;!--!*#--&gt;Whoops, it did not attach...here is the program (it's in C language):&lt;BR /&gt;&lt;BR /&gt;&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;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;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You run it interactively to obtain the encrypted password, then you can use the result in useradd.sam&lt;/PASSWORD_TO_ENCRYPT&gt;&lt;/TIME.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 15 Jul 2008 18:22:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234275#M329060</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-07-15T18:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234276#M329061</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;Here's a simple Perl script to generate an encrypted password that you can use with your 'useradd':&lt;BR /&gt;&lt;BR /&gt;# cat .pwgen&lt;BR /&gt;#!/usr/bin/perl -l&lt;BR /&gt;die "One arg expected\n" unless @ARGV;&lt;BR /&gt;print crypt(&lt;BR /&gt;    $ARGV[0],&lt;BR /&gt;    join( '',&lt;BR /&gt;        ( '.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z' )[ rand 64, rand 64 ] )&lt;BR /&gt;);&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./pwgen plaintext&lt;BR /&gt;&lt;BR /&gt;The script's output is your corresponding encrypted password.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Jul 2008 19:28:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234276#M329061</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-07-15T19:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234277#M329062</link>
      <description>awk -F: '{print $1, $2, $3, $4, $5, $6, $7}' /tmp/user | while read user pwd uid gid gecos home shell&lt;BR /&gt;do&lt;BR /&gt;useradd -u ${uid} -g ${gid} -c "${gecos}" -d ${home} -m -s ${shell} ${user}&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Jul 2008 00:43:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234277#M329062</guid>
      <dc:creator>Mark Trux</dc:creator>
      <dc:date>2008-07-16T00:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234278#M329063</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Take a look at another possibility.&lt;BR /&gt;&lt;BR /&gt;I wrote it for Unix support team who&lt;BR /&gt;needed to add around 500 Unix accounts&lt;BR /&gt;on AIX, Linux, Solaris and HP-UX servers&lt;BR /&gt;(without manual intervention):&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;Cheers,&lt;BR /&gt;&lt;BR /&gt;VK2COT</description>
      <pubDate>Wed, 16 Jul 2008 01:40:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234278#M329063</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2008-07-16T01:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234279#M329064</link>
      <description>Thanks to you all, it will take me time to review all the info. You are Greatfull.&lt;BR /&gt;&lt;BR /&gt;May I say that this is not a critical machine, it's for only one aplication, and only LAN use, so I can't change the requirements (username = passwd) but hurts!&lt;BR /&gt;&lt;BR /&gt;thanks one more time. I keep working.</description>
      <pubDate>Wed, 16 Jul 2008 06:24:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234279#M329064</guid>
      <dc:creator>Lluis Clemente</dc:creator>
      <dc:date>2008-07-16T06:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234280#M329065</link>
      <description>This seems perfect!&lt;BR /&gt;Thanks one more time.&lt;BR /&gt;Now I know exactly what I need.</description>
      <pubDate>Wed, 16 Jul 2008 08:33:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234280#M329065</guid>
      <dc:creator>Lluis Clemente</dc:creator>
      <dc:date>2008-07-16T08:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234281#M329066</link>
      <description>Sorry once again.&lt;BR /&gt;I'm having problems with useradd.sam parameters.&lt;BR /&gt;./useradd.sam -d /opt/oracle/tstusr -m &lt;BR /&gt;&lt;BR /&gt;With useradd this would create the home dir in the specified folder, but with useradd.sam, it creates the user, writes the /home atribute correctly, but doesn't create it.&lt;BR /&gt;any ideas?&lt;BR /&gt;thks.&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jul 2008 08:49:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234281#M329066</guid>
      <dc:creator>Lluis Clemente</dc:creator>
      <dc:date>2008-07-17T08:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234282#M329067</link>
      <description>---sorry.&lt;BR /&gt;I'll do :&lt;BR /&gt;&lt;BR /&gt;useradd -d $home user&lt;BR /&gt;usermod.sam -p $passwd user&lt;BR /&gt;&lt;BR /&gt;as the script did...&lt;BR /&gt;so it creates the path</description>
      <pubDate>Thu, 17 Jul 2008 09:05:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234282#M329067</guid>
      <dc:creator>Lluis Clemente</dc:creator>
      <dc:date>2008-07-17T09:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Making a useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234283#M329068</link>
      <description>Hi Lluis:&lt;BR /&gt;&lt;BR /&gt;As you conclude, please see:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums12.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums12.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 17 Jul 2008 11:27:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/making-a-useradd-script/m-p/4234283#M329068</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-07-17T11:27:00Z</dc:date>
    </item>
  </channel>
</rss>

