<?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: Merge /etc/passwd between two servers removing sys accounts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/merge-etc-passwd-between-two-servers-removing-sys-accounts/m-p/4114478#M313761</link>
    <description>This should get you started:&lt;BR /&gt;&lt;BR /&gt;---------------------------&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;INFILE=/etc/passwd&lt;BR /&gt;&lt;BR /&gt;awk -F ':' '{ if (($3 + 0) &amp;gt;= 101) {print $0}}' ${INFILE}&lt;BR /&gt;&lt;BR /&gt;This will read /etc/passwd and output on stdout all lines where UID (field 3) is &amp;gt;= 101 -- ie, it will exclude all of the system accounts. The ($3 + 0) is intentional if seemingly nonsensical because it forces the evaluation into a numeric rather than a string context.</description>
    <pubDate>Mon, 10 Dec 2007 20:52:51 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2007-12-10T20:52:51Z</dc:date>
    <item>
      <title>Merge /etc/passwd between two servers removing sys accounts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merge-etc-passwd-between-two-servers-removing-sys-accounts/m-p/4114477#M313760</link>
      <description>Hello All,&lt;BR /&gt;&lt;BR /&gt;I have two rp3440 running 11.11 in a clustered environment. I'm look to merge the two /etc/passwd files. The only issue is that I need to remove all system accounts (i.e. root, bin, sys,) So that I don’t have duplicate accounts. The way I have the two server setup is that so all users on serverA UID falls between 1000 – 2999 and all users on serverB UID’s fall between 3000 – 4999. I would like to just remove all entries in /etc/passwd with a UID lower that 1000 on serverA.  I would also like to script this process. I was looking I was looking at doing a sort on the file first but kind of lost after that. Any help is much appreciated. &lt;BR /&gt;&lt;BR /&gt;-Paul</description>
      <pubDate>Mon, 10 Dec 2007 20:31:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merge-etc-passwd-between-two-servers-removing-sys-accounts/m-p/4114477#M313760</guid>
      <dc:creator>Romanek</dc:creator>
      <dc:date>2007-12-10T20:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merge /etc/passwd between two servers removing sys accounts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merge-etc-passwd-between-two-servers-removing-sys-accounts/m-p/4114478#M313761</link>
      <description>This should get you started:&lt;BR /&gt;&lt;BR /&gt;---------------------------&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;INFILE=/etc/passwd&lt;BR /&gt;&lt;BR /&gt;awk -F ':' '{ if (($3 + 0) &amp;gt;= 101) {print $0}}' ${INFILE}&lt;BR /&gt;&lt;BR /&gt;This will read /etc/passwd and output on stdout all lines where UID (field 3) is &amp;gt;= 101 -- ie, it will exclude all of the system accounts. The ($3 + 0) is intentional if seemingly nonsensical because it forces the evaluation into a numeric rather than a string context.</description>
      <pubDate>Mon, 10 Dec 2007 20:52:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merge-etc-passwd-between-two-servers-removing-sys-accounts/m-p/4114478#M313761</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-12-10T20:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Merge /etc/passwd between two servers removing sys accounts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merge-etc-passwd-between-two-servers-removing-sys-accounts/m-p/4114479#M313762</link>
      <description>Hi Paul:&lt;BR /&gt;&lt;BR /&gt;As far as culling accounts you can simply do something like:&lt;BR /&gt;&lt;BR /&gt;# awk -F: '$3&amp;gt;=1000 &amp;amp;&amp;amp; $3&amp;lt;= 2999' /etc/passwd &amp;gt; /tmp/passwd.serverA&lt;BR /&gt;&lt;BR /&gt;The resulting file could be concatenated with the file from ServerB assuming that there are no duplicate login names.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Dec 2007 21:01:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merge-etc-passwd-between-two-servers-removing-sys-accounts/m-p/4114479#M313762</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-12-10T21:01:02Z</dc:date>
    </item>
  </channel>
</rss>

