Operating System - HP-UX
1829143 Members
2087 Online
109986 Solutions
New Discussion

Re: script to create multiple users on multiple servers

 
Stephen Young_1
Occasional Advisor

script to create multiple users on multiple servers

Hi,

Has anyone got script to create multiple users on multiple servers (HP 10.20 & 11)

Cheers in advance
4 REPLIES 4
Ian Dennison_1
Honored Contributor

Re: script to create multiple users on multiple servers

How about 'useradd'? Allows you to specify the UID, group, home directory, shell, etc. SHould be common across versions of HP-UX.

Alternatively (and probably illegally), why not just append one passwd file to the existing passwd file then tar the home directories? As long as the user only has primary group membership, they will not need to go into the /etc/group file (HP-UX 11 only - I think 10.20 insists on all group memberships being present in the /etc/group file).

Share and Enjoy! Ian
Building a dumber user
Peter Kloetgen
Esteemed Contributor

Re: script to create multiple users on multiple servers

Hi,

you can do it simply with the following:

for i in $*
do
useradd -m $1
done

usage of script:

script_name list_of_users_you_want_to_create
I'm learning here as well as helping
John Carr_2
Honored Contributor

Re: script to create multiple users on multiple servers

Hi

there are grave disadvantages to doing this
checkout NIS and NIS+ .

The pupose of Network Information Services is to store information that users, workstations , servers and applications must have to communicate across a network. Without a network information service, each workstation would have to maintain its own copy of this information.

NIS and NIS plus is part of the o/s easily configurable and not charged for.

good luck
John.
Ceesjan van Hattum
Esteemed Contributor

Re: script to create multiple users on multiple servers

Why you do not use autofs (automounter) to have one /home shared over all systems ?

In my expierence, i don't like to give users multiple locations. After setting up automountd, maintance becomes really easy... and yes.. make sure to have all UID etc the same by using one general useradd script (which you also can start on /home/root/bin/my_useradd, once you have /home running on automounter).

greetings