GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script for Creating Users on Multiple system i...
Operating System - HP-UX
1848686
Members
7740
Online
104035
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
05-06-2007 06:40 PM
05-06-2007 06:40 PM
Script for Creating Users on Multiple system in ons go!!!
Hi All,
Can you ppl suggest me a Script for creating user on multiple system of HP_UX, in which it has to include all basic attributes such as shell, GID and UID etc.
Can you ppl suggest me a Script for creating user on multiple system of HP_UX, in which it has to include all basic attributes such as shell, GID and UID etc.
Insanity is often the logic of mind overtasked!!!
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 07:43 PM
05-06-2007 07:43 PM
Re: Script for Creating Users on Multiple system in ons go!!!
Hi Saurabh Rawat,
Maybe u can do this,
1. Put all username in file/def.txt
2. create new file in with below input.
#!/bin/sh
for USER in `cat /home/abc/def.txt`
do
echo $USER
useradd -m $USER
passwd -d $USER
passwd -f $USER
done
3. chmod u+x <script name> and run the script.
Hav fun!
Maybe u can do this,
1. Put all username in file
2. create new file in
#!/bin/sh
for USER in `cat /home/abc/def.txt`
do
echo $USER
useradd -m $USER
passwd -d $USER
passwd -f $USER
done
3. chmod u+x <script name> and run the script.
Hav fun!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 08:42 PM
05-06-2007 08:42 PM
Re: Script for Creating Users on Multiple system in ons go!!!
Hi Saurabh,
Make a text file as below containing all the user attributes
saurabhr 245 16 /home/saurabhr /usr/bin/sh
rasheedt 246 16 /home/rashedt /usr/bin/ksh
cat userlist | while read un uid gid dir shell
do
echo $un $uid $gid $dir $shell
useradd -u $uid -g $gid -d $dir -s $shell -m $un
done
(un = username, uid = user id, gid = group id, dir=home dir, shell=default shell for the user)
The group id should pre-exist on the systems.
For multiple systems, you should make one system trusted and trigger the above script from one central server. You could make a filename with list of hostnames and run it with remsh or ssh according to your setup.
Make a text file as below containing all the user attributes
saurabhr 245 16 /home/saurabhr /usr/bin/sh
rasheedt 246 16 /home/rashedt /usr/bin/ksh
cat userlist | while read un uid gid dir shell
do
echo $un $uid $gid $dir $shell
useradd -u $uid -g $gid -d $dir -s $shell -m $un
done
(un = username, uid = user id, gid = group id, dir=home dir, shell=default shell for the user)
The group id should pre-exist on the systems.
For multiple systems, you should make one system trusted and trigger the above script from one central server. You could make a filename with list of hostnames and run it with remsh or ssh according to your setup.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP