[HPADM] SUMMARY: /etc/passwd question to create login id

From: Lal, Neeraj (neeraj_lal@mcgraw-hill.com)
Date: Thu Mar 25 2004 - 11:18:56 EST


Hi Thanks to all for quick response - Ling , Hartman, Pravez, John
 
Everybody suggested that if the server is not trusted it will work just take care of uid i-e uid should be unique and have to create home dir . If trusted system look for tcb auth file also.
 
Pravez also gave me script which he is using to create home dir
 
# more create_home.sh
#!/usr/bin/sh
#
cat /etc/passwd | while read line
do
   USERNAME=$(echo $line | awk -F : '{print $1}')
   UID=$(echo $line | awk -F : '{print $3}')
   GID=$(echo $line | awk -F : '{print $4}')
   if [ $UID -gt 200 -a $UID -lt 600 ]
   then
      if [ ! -d /home/$USERNAME ]
      then
         GROUPNAME=$(cat /etc/group | grep $GID | awk -F : '{print $1}')
         mkdir /home/$USERNAME
         chown $USERNAME:$GROUPNAME /home/$USERNAME
         chmod 711 /home/$USERNAME
         cp /etc/skel/.cshrc /home/$USERNAME
         chown $USERNAME:$GROUPNAME /home/$USERNAME/.cshrc
         cp /etc/skel/.exrc /home/$USERNAME/.exrc
         chown $USERNAME:$GROUPNAME /home/$USERNAME/.exrc
         cp /etc/skel/.login /home/$USERNAME/.login
         chown $USERNAME:$GROUPNAME /home/$USERNAME/.login
         cp /etc/skel/.profile /home/$USERNAME/.profile
         chown $USERNAME:$GROUPNAME /home/$USERNAME/.profile
      else
         echo "User: $USERNAME UID:$UID GID:$GID"
      fi
   fi
done
 
 
 
-----Original Message-----
From: hpux-admin-owner@DutchWorks.nl [mailto:hpux-admin-owner@DutchWorks.nl] On Behalf Of Lal, Neeraj
Sent: Thursday, March 25, 2004 10:53 AM
To: hpux-admin@dutchworks.nl
Subject: [HPADM] /etc/passwd question to create login id
 
Hi Admin
 
I have a question
If I will take the user info from etc passwd file (cut a line ) and append the same into passswd file on another server.
 
My question
 
1. what else would I have to do create the same user with same passwd on another server or this will not at all work.
 
Thanks
 
 
Neeraj. Lal.
Consultant
The McGraw-Hill Companies Inc
148 Princeton-Hightstown Road
Hightstown, NJ 08520
email: neeraj_lal@mcgraw-hill.com <mailto:neeraj_lal@mcgraw-hill.com>
 

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:39 EDT