- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: add 50 users/10 boxes
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2006 05:44 AM
10-31-2006 05:44 AM
add 50 users/10 boxes
I have a task to add 50 users to 10 boxes, can anyone guide me with a script that can do this? these are hp-ux 11.11 boxes using the standard /etc/passwd file. Please give me a start..
Thanks
brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2006 05:50 AM
10-31-2006 05:50 AM
Re: add 50 users/10 boxes
Use 'useradd'. You can easily build a script that makes the call. See:
http://docs.hp.com/en/B2355-60127/useradd.1M.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2006 05:58 AM
10-31-2006 05:58 AM
Re: add 50 users/10 boxes
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2006 06:03 AM
10-31-2006 06:03 AM
Re: add 50 users/10 boxes
Let say you have these 50 users created and you take these 50 users information (uname, uid, gid, home_dir, shell ...) from /etc/passwd file and put them in a file call it userinfo
The script can be written like this:
#!usr/bin/ksh
while read line
do
uname=`echo $line|cut -d":" -f1`
pwd=`echo $line|cut -d":" -f2`
uid=`echo $line|cut -d":" -f3`
gid=`echo $line|cut -d":" -f4`
home=`echo $line|cut -d":" -f6`
shell=`echo $line|cut -d":" -f7`
/usr/sbin/user -u $uid -g $gid -d $home -s $shell -m $uname
/usr/sam/lbin/usermod.sam -p $pwd $uname
done < /path_to/userinfo
exit
If you want to create passwords for users you may use encrypt or perl crypt() function to create encrypted passwords because "usermod.sam" need to use encrypted password as input.
Yang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2006 02:43 PM
10-31-2006 02:43 PM