Creating User in multiple server
Dear frnz,
I am facing a problem. Actually cant say its a problem. In my cluster I have to create multiple user with same user id and with same password in multiple server. Mean I will create user in one server same time it will update my another server. I can do it manullay by creating tar file and move it to another server.
But I wanted to do it automatically. It needs an script. Please help if anyone do so.
Responses
Shyfur,
Would rsync be an option to distribute the new password, group and shadow file to all nodes?
vi remote-useradd.sh
========================================================
useradd $1
for remote in `cat node-list.txt`
do
rsync -avR /etc/passwd remote:/
rsync -avR /etc/group remote:/
rsync -avR /etc/shadow remote:/
rsync -avR /home/$1 remote:/
done
=========================================================
chmod 0700 remote-useradd.sh
This is what I could think off.
Test it first with only a single node in node-list.txt
Kind regards,
Jan Gerrit Kootstra
Shyfur,
What kind of Domain are you talking about?
If it is a Windows Domain, like Active Directory then a Red Hat Directory server might be an option.
The users could be stored in the Windows Active Directory and Red Hat Directory server can synchronise with it.
Your cluster nodes could use the Red Hat Directory server as an ldap server.
Ok, it is not for free but it might be a solution if you are dealing with many users and many servers that need the same users.
We use an openldap server and each new server I need to manage automagically creates my user's homedir at first login. Always same userid and groupid. These are stored in the ldap server.
Kind regards,
Jan Gerrit Kootstra
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
