- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: creating new user id in few servers at the sam...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
06-24-2003 07:46 PM
06-24-2003 07:46 PM
How do i create few user id in few servers (10 servers) at the same time, without using sam?
Thanks
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2003 07:58 PM
06-24-2003 07:58 PM
Re: creating new user id in few servers at the same time
1. NIS/NIS+ is prefered if you want;
2. If .rhosts file is correctly configured, you can use "rexec" to achieve it! That is, you can make a script use multiple "rexec" command!
Good luck!
-ux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2003 08:19 PM
06-24-2003 08:19 PM
SolutionA good documentation here on configuring NIS.
http://docs.hp.com/hpux/onlinedocs/B1031-90048/B1031-90048.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2003 08:49 PM
06-24-2003 08:49 PM
Re: creating new user id in few servers at the same time
I would say write a small script containing series of useradd commands. Copy this script to all your 10 machines (you have to logon to them anyway to setup ssh or .rhosts) and run it. Your script may look like
useradd -u 1000 -g 500 -d /home/user1 -s /usr/bin/ksh -C "User1, xxx-xxx-xxxx" -m -k /etc/skel user1
passwd -df user1
useradd -u 1000 -g 500 -d /home/user2 -s /usr/bin/ksh -C "User2, xxx-xxx-xxxx" -m -k /etc/skel user2
passwd -df user2
useradd -u 1000 -g 500 -d /home/user3 -s /usr/bin/ksh -C "User3, xxx-xxx-xxxx" -m -k /etc/skel user3
passwd -df user3
..
This isn't a real secured way of setting passwords. But you don't have much choice here to get it accomplished in a short time.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 06:50 AM
06-26-2003 06:50 AM
Re: creating new user id in few servers at the same time
If you are using one machine as a master-host and the other as clients, and you're going to use the same username/UID, group/GID, password, home directory etc... (identical setup)
WARNING: This is not recommended if you are keeping separate/individual setup of the machines.
You could grep the user out of the passwd file from the master and add it directly into the passwd file of the client...
I think this is better than copying the file itself.
root@client# remsh master grep newuser >> /etc/passwd
Then create the home directory simply by rcp it from the master to the client
Copy the home directory:
root@client# rcp -pr master:/home/newuser /home/
Copy group file:
not a good idea if you're keeping individual groups on the servers
root@client# rcp -p master:/etc/group /etc/group
Not an elegant way to do it...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 07:40 AM
06-26-2003 07:40 AM
Re: creating new user id in few servers at the same time
use sudo on all your boxes:
in your sudoers file add, commands.
useradd,usermod,/usr/lbin/modprpw,/usr/bin/passwd etc
then use remsh
for x in `cat serverlist`
do
echo $x
remsh $x "sudo /usr/bin/useradd -u 400 -m -k /etc/skel -d /home/
remsh $x "sudo /usr/bin/usermod -g users -G
remsh $x "sudo /usr/lbin/modprpw -x
done >myresults_with_passwords
hey that will take you less than 2 minutes to complete.
peace
donny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 07:42 AM
06-26-2003 07:42 AM
Re: creating new user id in few servers at the same time
remsh $x "sudo /usr/bin/usermod -g users -G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 07:50 AM
06-26-2003 07:50 AM
Re: creating new user id in few servers at the same time
user1 1000 adam eve
user2 1001 joe soap
.
.
.
user100 1100 rudy juliani
save the file as "mynewusers"
same for loop with a twist.
for x in `cat serverlist`
do
echo $x
while read loginid uid first last
do
remsh $x "sudo /usr/bin/useradd -u ${uid} -m -k /etc/skel -d /home/${loginid} -s /usr/local/bin/bash -c \"${first} ${last}\" ${loginid}; sudo /usr/lbin/modprpw -x ${loginid}; sudo /usr/bin/usermod -g users ${loginid}"
done
say that does'nt work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 11:04 AM
06-26-2003 11:04 AM
Re: creating new user id in few servers at the same time
You may want to think ahead and make sure the users' UID numbers are unique accross all Unix nodes on your LAN if you plan to share filesystems via NFS or DCE. The same needs to be insured for the users' GID numbers. I have built a cron'd script that pulls the /etc/passwd file from each NIS server on our network. I then process each /etc/passwd file to produce a "normalized" passwd file. I check this normalized passwd file for logical inconsistencies: A user(identified by his or her login "handle") with more than one UID number assigned to him/her. A UID number possessed by more than one User "handle". Both of these inconsistencies must be resolved to maintain the integrity of the /etc/passwd files among our NIS servers. In our shop a user's handle consists of a single alpha character, followed by their 5 digit employee badge number. We have regular and temporary employees and the alpha character differentiates these. We also provide an editable file, the uid.register, to enable controlling the assignment of unique UID numbers to new users. This register is regenerated daily by the scripts I built. The register contains: User's handle, user's UID, user's name and NIS_Platform.
This may be more than you need, but networks have a way of growing and becoming more complex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 02:02 PM
06-26-2003 02:02 PM
Re: creating new user id in few servers at the same time
For this problem start to use NIS
or you a hard way is to copy the passwd file
to all stations, create directorys and so on.
Run the creation of user on all the station
(you can made a script)
The best is NIS!
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 02:38 PM
06-26-2003 02:38 PM
Re: creating new user id in few servers at the same time
Here's a quick-and-dirty shell script (real syadmins do it from the prompt!)
for HOST in HOST1 HOST2 HOST3 HOST4......
do
echo $HOST
ssh $HOST "useradd -u UID -g GID -s /bin/sh -d /home/USERNAME -c COMMENT USERNAME"
done
This, of course assumes you have secure shell set up, all your GID's, UID's and such are non-duplicating, and that you're fairly sure this won't break anything (here, it doesn't: we're careful). You could use remsh instead of ssh if necessary.
Chris