Creating User in multiple server

Latest response

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

Why not create a NIS server ?

it will make the whole solution much easy to manage.

 

-Erez

Thanks for eur reply Erez.

 

Nis is server will not solve my issue...

I made a domain cluster. Where user ID shoudl be same on each node.

 

So I need a scripts for this solution.

 

rgds.

Shyfur

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,

 

 

If you want to do this in batch mode you may need to use ssh keys to avoid multiple root password questions.

 

This may be considered a security issue.

 

 

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

Thank you Jan Gerrit Kootstra,

 

I will try what eu said. Actually I have created a domain server wil Samba. My clients wanted to make it cluster. Cluster is done. What I did manually transfer users and password from one node to another it works fine now It will tough to do it manually for client. So I wanted to make it automated.... Lets see how eur solutions works.,,,,

 

Thanks again.

 

rgds.

 

Shyfur