- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Script to Push Users
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
Discussions
Discussions
Forums
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
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
тАО01-23-2008 11:58 AM
тАО01-23-2008 11:58 AM
I'm wondering if someone might have a script that they would like to share that would be handy to push users, home directories, and profiles to other hosts? We can't run NIS and that is not an option for us.
What I would ideally like to do is have one of our HP-UX servers be the initial place that users get created and then run a script to push the user out once the user is created on this first server. Method of push may be ssh or maybe rsync? Any ideas, examples, or suggestions would be very greatly appreciated.
Thanks!!!!
KPS
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2008 12:39 PM
тАО01-23-2008 12:39 PM
Re: Script to Push Users
Create file with a list of all your hostnames. Then edit whats in < -- > in the line below for each new useradd.
This is for one user at a time.
for h in `cat hostlist`
do
echo $h":\c"
remsh $h -n /usr/sbin/useradd -u
/etc/
echo "Will add user $b to $h "
remsh $h -n /usr/bin/passwd -f -n 56 -x 7 $b
echo "User $b has password set on $h"
done
done
Hope this helps, watch out for typos
Rgrds,
Rita
- Tags:
- useradd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2008 12:43 PM
тАО01-23-2008 12:43 PM
Re: Script to Push Users
Create a file with the new login id's too.
Then it should read more like this at the top:
for h in `cat hostlist`
do
for b in `cat /scripts/login_id.lis`
do
echo $h":\c"
echo $b
(and so forth....)
....now that $b variable makes sense.
/rcw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2008 01:41 PM
тАО01-23-2008 01:41 PM
SolutionThis works in 2 parts. 1st part gathers the info and 2nd part executes the adduser command on the remote systems.
No NIS is involved but we did make sure that the UIDs were the same across all other systems.
As always, carefully review and use at your risk.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2008 01:43 PM
тАО01-23-2008 01:43 PM
Re: Script to Push Users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2008 06:12 PM
тАО01-23-2008 06:12 PM
Re: Script to Push Users
Thanks for your help, but the first of the 2 attachments didn't seem like it came over in the right format. Could you send again?
Thanks,
KPS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2008 07:49 PM
тАО01-23-2008 07:49 PM
Re: Script to Push Users
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2008 11:29 AM
тАО01-24-2008 11:29 AM
Re: Script to Push Users
Thanks so much!
KPS