<?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: Creating new user with script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884643#M280477</link>
    <description>&lt;!--!*#--&gt;Hey;&lt;BR /&gt;&lt;BR /&gt;If you want to put the password in on an HP box w/o the use of expect, you're stuck with usermod.sam or ueradd.sam.  How you differentiate between Linux and HPUX is through a variable:&lt;BR /&gt;&lt;BR /&gt;Os=$(uname -s)&lt;BR /&gt;[[ "${Os}" = "HP-UX" ]] &amp;amp;&amp;amp; Useradd=/usr/sam/lbin/useradd.sam || \&lt;BR /&gt;   Useradd=/usr/sbin/useradd&lt;BR /&gt;uid=1000&lt;BR /&gt;&lt;BR /&gt;cat passwd.1 | while read user pwd&lt;BR /&gt;do&lt;BR /&gt;   printf "%-8s %s\n" ${user} ${pwd}&lt;BR /&gt;   ${Useradd} -u ${uid} -g users -c "test user" -d /home/${user} \&lt;BR /&gt;      -p ${pwd} -s /bin/ksh ${user}&lt;BR /&gt;   mkdir -p -m 755 /home/${user}&lt;BR /&gt;   cp /etc/skel/.[A-z]* /home/${user}&lt;BR /&gt;   chown -R ${user}:users /home/${user}&lt;BR /&gt;   uid=$((uid+1))&lt;BR /&gt;done</description>
    <pubDate>Tue, 24 Oct 2006 07:36:29 GMT</pubDate>
    <dc:creator>Doug O'Leary</dc:creator>
    <dc:date>2006-10-24T07:36:29Z</dc:date>
    <item>
      <title>Creating new user with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884638#M280472</link>
      <description>Hi &lt;BR /&gt;I have one text file containing first field as user id and second field as passwd.I would like to write a script which will add the new users with this user id and password with out any interaction.(it should take the second field as the input for passwd command).Can anybody help in this?&lt;BR /&gt;&lt;BR /&gt;Thanx in advance&lt;BR /&gt;Jerry</description>
      <pubDate>Mon, 23 Oct 2006 00:49:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884638#M280472</guid>
      <dc:creator>Jerry P Antony_1</dc:creator>
      <dc:date>2006-10-23T00:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new user with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884639#M280473</link>
      <description>Are those passwords encrypted? If they are not encrypted, you may need to encrypt passowrds first because the command to assign the password for a user use encrypted password. I assume that 1st and 2nd fields in passwd.1 are with the same format as /etc/passwd&lt;BR /&gt;user_account_name:encrypted_password&lt;BR /&gt;You will let the system to select UID and you will use default group id (otherwise, you can use -u UID -g GID in useradd command to define UID and GID):&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;   uname=`echo $line|cut -d":" -f1`&lt;BR /&gt;   passwd=`echo $line|cut -d":" -f2`&lt;BR /&gt;   useradd -m $uname&lt;BR /&gt;   /usr/sam/lbin/usermod.sam -p $passwd&lt;BR /&gt;done &amp;lt; passwd.1&lt;BR /&gt;&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Yang</description>
      <pubDate>Mon, 23 Oct 2006 01:12:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884639#M280473</guid>
      <dc:creator>Yang Qin_1</dc:creator>
      <dc:date>2006-10-23T01:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new user with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884640#M280474</link>
      <description>Yang&lt;BR /&gt;Thanx for your reply.&lt;BR /&gt;The password is not encripted.I perfer not to use usermod.sam because I need to do the same excercise on my linux file server also.Is there any common shell script which can do this?&lt;BR /&gt;Jerry</description>
      <pubDate>Mon, 23 Oct 2006 01:18:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884640#M280474</guid>
      <dc:creator>Jerry P Antony_1</dc:creator>
      <dc:date>2006-10-23T01:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new user with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884641#M280475</link>
      <description>Hi,&lt;BR /&gt;this thread could help you:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=952123&amp;amp;admit=-682735245+1125402405698+28353475" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=952123&amp;amp;admit=-682735245+1125402405698+28353475&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Tue, 24 Oct 2006 02:45:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884641#M280475</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2006-10-24T02:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new user with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884642#M280476</link>
      <description>Hi, Jerry, If you want to run the same script on both HPUX and Linux. You may have a look at "expect" &lt;A href="http://wiki.tcl.tk/201" target="_blank"&gt;http://wiki.tcl.tk/201&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Yang</description>
      <pubDate>Tue, 24 Oct 2006 07:13:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884642#M280476</guid>
      <dc:creator>Yang Qin_1</dc:creator>
      <dc:date>2006-10-24T07:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new user with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884643#M280477</link>
      <description>&lt;!--!*#--&gt;Hey;&lt;BR /&gt;&lt;BR /&gt;If you want to put the password in on an HP box w/o the use of expect, you're stuck with usermod.sam or ueradd.sam.  How you differentiate between Linux and HPUX is through a variable:&lt;BR /&gt;&lt;BR /&gt;Os=$(uname -s)&lt;BR /&gt;[[ "${Os}" = "HP-UX" ]] &amp;amp;&amp;amp; Useradd=/usr/sam/lbin/useradd.sam || \&lt;BR /&gt;   Useradd=/usr/sbin/useradd&lt;BR /&gt;uid=1000&lt;BR /&gt;&lt;BR /&gt;cat passwd.1 | while read user pwd&lt;BR /&gt;do&lt;BR /&gt;   printf "%-8s %s\n" ${user} ${pwd}&lt;BR /&gt;   ${Useradd} -u ${uid} -g users -c "test user" -d /home/${user} \&lt;BR /&gt;      -p ${pwd} -s /bin/ksh ${user}&lt;BR /&gt;   mkdir -p -m 755 /home/${user}&lt;BR /&gt;   cp /etc/skel/.[A-z]* /home/${user}&lt;BR /&gt;   chown -R ${user}:users /home/${user}&lt;BR /&gt;   uid=$((uid+1))&lt;BR /&gt;done</description>
      <pubDate>Tue, 24 Oct 2006 07:36:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884643#M280477</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2006-10-24T07:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new user with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884644#M280478</link>
      <description>Friends &lt;BR /&gt;Thanx for the reply. We have Holy Ramadan vacation here and not in a position to try out the option.I will try after the vaction and update you.</description>
      <pubDate>Tue, 24 Oct 2006 15:34:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884644#M280478</guid>
      <dc:creator>Jerry P Antony_1</dc:creator>
      <dc:date>2006-10-24T15:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new user with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884645#M280479</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;You can try this for adding users:&lt;BR /&gt;&lt;BR /&gt;while read username password&lt;BR /&gt;do&lt;BR /&gt;useradd [options] ${username}&lt;BR /&gt;done &amp;lt; your_file&lt;BR /&gt;&lt;BR /&gt;Still thinking about how to automatically assign passwords to new user.</description>
      <pubDate>Wed, 25 Oct 2006 06:11:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-new-user-with-script/m-p/3884645#M280479</guid>
      <dc:creator>Igor Sovin</dc:creator>
      <dc:date>2006-10-25T06:11:43Z</dc:date>
    </item>
  </channel>
</rss>

