<?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: Useradd script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042816#M433174</link>
    <description>Just to add -&amp;gt; I would like to create a text file from the master server and use the information from it to create the users on another server.</description>
    <pubDate>Thu, 26 Apr 2007 15:11:53 GMT</pubDate>
    <dc:creator>mtfahey</dc:creator>
    <dc:date>2007-04-26T15:11:53Z</dc:date>
    <item>
      <title>Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042813#M433171</link>
      <description>I need to add about 50 users and would like to do it with a shell script. These users are on other servers. I need to keep their UID the same on all servers. They can all have the same password and force them to change it on log in. HP-UX 11.23, korn shell. Points to be awarded!</description>
      <pubDate>Thu, 26 Apr 2007 14:34:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042813#M433171</guid>
      <dc:creator>mtfahey</dc:creator>
      <dc:date>2007-04-26T14:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042814#M433172</link>
      <description>1) Where are you pulling the list of users/UIDs from (e.g. multiple copies of /etc/passwd on different servers, a single textfile, etc.)?&lt;BR /&gt;2) Is it safe to assume that a user's UID is unique?</description>
      <pubDate>Thu, 26 Apr 2007 14:45:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042814#M433172</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-04-26T14:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042815#M433173</link>
      <description>I'm pulling the information from /etc/passwd on the master server.  All the UIDs are unique.</description>
      <pubDate>Thu, 26 Apr 2007 14:51:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042815#M433173</guid>
      <dc:creator>mtfahey</dc:creator>
      <dc:date>2007-04-26T14:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042816#M433174</link>
      <description>Just to add -&amp;gt; I would like to create a text file from the master server and use the information from it to create the users on another server.</description>
      <pubDate>Thu, 26 Apr 2007 15:11:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042816#M433174</guid>
      <dc:creator>mtfahey</dc:creator>
      <dc:date>2007-04-26T15:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042817#M433175</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;first make sure, that no new UID is already present in /etc/passwd of the new server.&lt;BR /&gt;Now extract the lines of the requested users from the original passwd to a file e.g. pw2add.&lt;BR /&gt;If the HOME will be different, modify pw2add.&lt;BR /&gt;&lt;BR /&gt;Having transformed the file to the new system, it depends on whether you use plain passwd authentication or the tcb (trusted system).&lt;BR /&gt;For plain passwd this is enough:&lt;BR /&gt;cp /etc/passwd /etc/passwd.1&lt;BR /&gt;cat pw2add &amp;gt;&amp;gt;/etc/passwd&lt;BR /&gt;awk -F: '{print $3,$4,$6}' pw2add |&lt;BR /&gt;while read uid gid dir&lt;BR /&gt;do&lt;BR /&gt;  mkdir -p $dir &amp;amp;&amp;amp; chown $uid:$gid $dir&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;If your system is trusted, let us know.&lt;BR /&gt;Just appending to /etc/passwd is not enough in that case.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Thu, 26 Apr 2007 15:25:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042817#M433175</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-04-26T15:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042818#M433176</link>
      <description>&lt;!--!*#--&gt;To extract the users I need from /etc/passwd I was going to use the following command: &lt;BR /&gt;&lt;BR /&gt; cat /etc/passwd |awk -F":" '$3 &amp;gt;= 1100 &amp;amp;&amp;amp; $3 &amp;lt;= 2999 {print $1 ":" $2 ":" $3 ":"$4 ":" $5 ":" $6 ":" $7}' &amp;gt; pw2add&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Apr 2007 16:35:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042818#M433176</guid>
      <dc:creator>mtfahey</dc:creator>
      <dc:date>2007-04-26T16:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042819#M433177</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the command you want to use is possible ...&lt;BR /&gt;&amp;gt;&amp;gt; cat /etc/passwd |awk -F":" '$3 &amp;gt;= 1100 &amp;amp;&amp;amp; $3 &amp;lt;= 2999 {print $1 ":" $2 ":" $3 ":"$4 ":" $5 ":" $6 ":" $7}' &amp;gt; pw2add&lt;BR /&gt;&amp;lt;&amp;lt;&lt;BR /&gt;... but I want to add some comments:&lt;BR /&gt;&lt;BR /&gt;- No need for the 'cat' - awk can open files by itself:&lt;BR /&gt;awk -F":" '$3 &amp;gt;= 1100 &amp;amp;&amp;amp; $3 &amp;lt;= 2999 {print $1 ":" $2 ":" $3 ":"$4 ":" $5 ":" $6 ":" $7}' /etc/passwd &amp;gt;pw2add&lt;BR /&gt;- Having exactly seven fields in the input file, there is no need to numerate the all explictly - the action can be simplified to&lt;BR /&gt;... {print $0} ...&lt;BR /&gt;wjich is identical to&lt;BR /&gt;... {print} ...&lt;BR /&gt;which is the default, so this is equivalent:&lt;BR /&gt;awk -F: '$3 &amp;gt;= 1100 &amp;amp;&amp;amp; $3 &amp;lt;= 2999' /etc/passwd &amp;gt;pw2add&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 27 Apr 2007 03:48:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042819#M433177</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-04-27T03:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042820#M433178</link>
      <description>Yeah, I just read that in the book I just bought.  Thank you very much!</description>
      <pubDate>Fri, 27 Apr 2007 06:30:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042820#M433178</guid>
      <dc:creator>mtfahey</dc:creator>
      <dc:date>2007-04-27T06:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042821#M433179</link>
      <description>Thank you all for assistance.</description>
      <pubDate>Tue, 01 May 2007 08:48:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042821#M433179</guid>
      <dc:creator>mtfahey</dc:creator>
      <dc:date>2007-05-01T08:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Useradd script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042822#M433180</link>
      <description>thanx</description>
      <pubDate>Tue, 01 May 2007 08:49:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-script/m-p/5042822#M433180</guid>
      <dc:creator>mtfahey</dc:creator>
      <dc:date>2007-05-01T08:49:01Z</dc:date>
    </item>
  </channel>
</rss>

