<?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: Add NIS user script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/add-nis-user-script/m-p/2819321#M86245</link>
    <description>Ok well the home directory is going to be on an NFS mount directory.  &lt;BR /&gt;&lt;BR /&gt;So I need help getting started on writing the script... like I am new to script writing anything real complex.  Just need guidance on getting started.&lt;BR /&gt;&lt;BR /&gt;Thx..Angie</description>
    <pubDate>Fri, 04 Oct 2002 17:16:07 GMT</pubDate>
    <dc:creator>Angie_1</dc:creator>
    <dc:date>2002-10-04T17:16:07Z</dc:date>
    <item>
      <title>Add NIS user script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-nis-user-script/m-p/2819319#M86243</link>
      <description>I would add a user through SAM, Add User, Add NIS user, but it doesn't create home directories unlike adding a local user.&lt;BR /&gt;So I need some guidance with writing a script to add a user to the NIS passwd.nis file, want to create a home directory for that user, and then copy some files into it.&lt;BR /&gt;&lt;BR /&gt;Please tell me how to go about doing this.  Case statements?  If statements.. I am so confused.&lt;BR /&gt;&lt;BR /&gt;Thanks...Angie</description>
      <pubDate>Fri, 04 Oct 2002 16:20:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-nis-user-script/m-p/2819319#M86243</guid>
      <dc:creator>Angie_1</dc:creator>
      <dc:date>2002-10-04T16:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add NIS user script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-nis-user-script/m-p/2819320#M86244</link>
      <description>This is a tricky problem because it greatly depends upon your environment. Typically, SAM can create a home directory on the NIS master server but generally you want a home directory elsewhere or maybe on multiple hosts. The most typical configuration is that the home directories are automounted and NIS maintains the automounter maps. In that scenario, no matter where a user logs in, his home directory is magically mounted although it might actually reside on a node far, far away.&lt;BR /&gt;&lt;BR /&gt;You could script a remsh to a remote host to create the home directory.&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Oct 2002 16:54:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-nis-user-script/m-p/2819320#M86244</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-10-04T16:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add NIS user script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-nis-user-script/m-p/2819321#M86245</link>
      <description>Ok well the home directory is going to be on an NFS mount directory.  &lt;BR /&gt;&lt;BR /&gt;So I need help getting started on writing the script... like I am new to script writing anything real complex.  Just need guidance on getting started.&lt;BR /&gt;&lt;BR /&gt;Thx..Angie</description>
      <pubDate>Fri, 04 Oct 2002 17:16:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-nis-user-script/m-p/2819321#M86245</guid>
      <dc:creator>Angie_1</dc:creator>
      <dc:date>2002-10-04T17:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add NIS user script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-nis-user-script/m-p/2819322#M86246</link>
      <description>First, you need to change your logic, specially since your new.&lt;BR /&gt;Instead of having a user added to NIS from your scripts maintain SAM for this purpose, and make a script to deal with home directories.&lt;BR /&gt;&lt;BR /&gt;If your using an automounter, then the problem is a bit more complex, but similar enough.  I'll assume your using automounter and auto.home for users in my example.  For basics though, remember a script is top down as with typing the commands manually.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;##########&lt;BR /&gt;echo "enter a user to make a home for"&lt;BR /&gt;read NEWUSR&lt;BR /&gt;TST=`grep $NEWUSR /etc/passwd|awk -F: '{print $1}'`&lt;BR /&gt;# Making sure there is such a user&lt;BR /&gt;if [ "${TST}x" = "x" ] ; then&lt;BR /&gt;  echo "No such user $TST"&lt;BR /&gt;  exit 1&lt;BR /&gt;elif [ "${TST}" = "NEWUSR" ] ; then&lt;BR /&gt;echo "Have user $TXT, going to process"&lt;BR /&gt;else&lt;BR /&gt;  echo "unknown error.  exiting"&lt;BR /&gt;fi# Have the user, so make the stuff...&lt;BR /&gt;GRP=`grep $NEWUSR /etc/passwd|awk -F: '{print $3}'`&lt;BR /&gt;#using GID is same as group name, and this is much easier&lt;BR /&gt;echo "$NEWUSR   hostname:/export/$NEWUSR" &amp;gt;&amp;gt;/etc/auto.home&lt;BR /&gt;&lt;BR /&gt;mkdir /export/$NEWUSR&lt;BR /&gt;chmod 755 /export/$NEWUSR&lt;BR /&gt;cp -p /etc/skel/.??* /export/$NEWUSR&lt;BR /&gt;&lt;BR /&gt;chown -R $NEWUSR:$GRP /export/$NEWUSR&lt;BR /&gt;&lt;BR /&gt;cd /var/yp&lt;BR /&gt;make auto.home&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Of course directories dont match yours, and Im sure you need to make lots of modifications, you may be using ypmake instead of make, etc..  The example is to show basics in scripting.  For info on the commands and routines in shells type&lt;BR /&gt;% man csh&lt;BR /&gt;% man sh&lt;BR /&gt;% man ksh&lt;BR /&gt;&lt;BR /&gt;Man pages are really our friends, just tend to be dry at times.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Fri, 04 Oct 2002 18:23:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-nis-user-script/m-p/2819322#M86246</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2002-10-04T18:23:47Z</dc:date>
    </item>
  </channel>
</rss>

