Koozali.org: home of the SME Server

sync users between 2 mitel boxes

john

sync users between 2 mitel boxes
« on: July 01, 2002, 04:46:55 PM »
Hi.

I have (2) mitel v5.1.2 servers here. One is my PDC, the other is just a stand alone server.

In order to have all the users/groups/passwords the same on both machines, I've used scp to copy the following files from the PDC to the stand-alone:
/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow
/etc/smbpasswd

Problem is, I'd like to create an ibay on server2, and be able to assign groups to it from within the server-manager. The users and groups (which I setup on the PDC) do not show up inside the server-manager on the stand alone server.

Is there another file or set of files the server-manager uses when it shows users and groups that I'd need to copy over as well?

thanks,
john

guestHH

Re: sync users between 2 mitel boxes
« Reply #1 on: July 01, 2002, 11:32:40 PM »
hmmmm. intresting question...

I'm in for an answer... ;-)

Regards,
guestHH

Nathan Fowler

Re: sync users between 2 mitel boxes
« Reply #2 on: July 01, 2002, 11:45:35 PM »
The below will only work if you wish to create a master-slave type relationship, or mirror the accounts on two boxes.  Mirroring [MASTER] to [SLAVE].

Continue to SCP the files:
/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow
/etc/smbpasswd

But also you must add:
/home/e-smith/accounts

Then, /sbin/e-smith/signal-event user-create for each username in /home/e-smith/accounts.

Probably the same for ibay-create, group-create, etc.  I'm not sure offhand what the signal-event commands are aside from user-create and user-modify.  You could probably construct a Perl script to do this better by checking for the existance of /home/e-smith/files/users/<%username%> to determine if the account needs to be created or not.

Because I run 4.1.2, my understanding of > 4.1.2 is limited.  If the accounts are stored in a database instead of an account this could be a little easier.

john

Re: sync users between 2 mitel boxes
« Reply #3 on: July 02, 2002, 05:17:59 AM »
Nathan Fowler wrote:
>
> Continue to SCP the files:
> /etc/passwd
> /etc/shadow
> /etc/group
> /etc/gshadow
> /etc/smbpasswd
> /home/e-smith/accounts
>
> Then, /sbin/e-smith/signal-event user-create for
> each username in /home/e-smith/accounts.

That seems to have mostly done it. Just two little caveats.

1) I scp'd everything over to #2, then ran /sbin...user-create for all users (3 in this case). And all was good.

I then added a new user on #1, and scp'd everything over to #2 again. I did NOT run the user-create signal-event again. And now everyone is showing up just fine in the server manager on #2. Users and groups transfer over just fine.

> Probably the same for ibay-create, group-create, etc.  I'm
> not sure offhand what the signal-event commands are aside
> from user-create and user-modify.  You could probably

i really don't want to mess with user or group creation on #2. I just want to be able to create a *new* ibay on #2, and assign users/groups which already exist on #1. Hence the scp'ing.

2) Here's the hopefully last problem. All the ibays I created on #1 are listed in the server-manager on #2. They don't actually exist on #2 (the directories aren't there), but they are listed. If I create a new ibay, it is created just fine. But it is added to the list.

Probable solution/cause: I had created a user and ibay on #2 when i was still experimenting with this. If I had not created the initial user/ibay on #2, everything would have probably been fine, and I may not have even needed to do the signal-event. I needed to delete the ibay directories I had created on #2, and remove the cloned ibays from the list in server-manager on #2.

Now all is apparently good. I'm sure I'll find something else as I get more into it and start using it for real here. But so far so good.

I may have to compile all this stuff together and create a how-to. :)

Thanks for your help.

--john

Michael Scholz

Re: sync users between 2 mitel boxes
« Reply #4 on: July 03, 2002, 12:49:03 PM »
Hi John,

i have a rpm witch is doing nearly what you want.
Let me know and i will send it to you.
I did not contribute it rigth now because i have to translate the Readme from
German into English. (and my english is not sooo good !).

The script uses the SME signal-events to create USERS, IBAYS and GROUPS
on both Servers. But the HOMES and IBAYS created at Server A not visible at
Server B. Not visible means they are physicly there but "not browseble".
Also you will have a new Pannel whitch will show you what is visible at Server A and not at Server B. ( This work vice and verse ).
The only thing you have to look is that this should be done on a fresh installed
SME to prevent a mix between the UID and GID.
(I could not revsole this problem now.)

If somebody else is interested in let me know and i will send it to you or place it somewhere for download.

Michael

john

Re: sync users between 2 mitel boxes
« Reply #5 on: July 03, 2002, 05:13:52 PM »
Michael Scholz wrote:
>
> i have a rpm witch is doing nearly what you want.
> Let me know and i will send it to you.
> I did not contribute it rigth now because i have to translate
> the Readme from
> German into English. (and my english is not sooo good !).
>
> If somebody else is interested in let me know and i will send
> it to you or place it somewhere for download.
>
> Michael

Michael,
I'm definately interested! Let me know where to download it.

And i have no problem doing a clean reinstall on server #2. It's all crap on there now as I'm just testing stuff with it. :)

thanks!
--john

p.s. if you'd like, send me the german read-me as well. I know a wee bit of german, and between babel-fish and a guy at work who speaks german, I can probably get you an english version.

robert

Re: sync users between 2 mitel boxes
« Reply #6 on: October 22, 2002, 08:24:19 AM »
hi !

i would be interested in your script AND
will put time to correct the english readme.

Prost!
Robert
Michael Scholz wrote:
>
> Hi John,
>
> i have a rpm witch is doing nearly what you want.
> Let me know and i will send it to you.
> I did not contribute it rigth now because i have to translate
> the Readme from
> German into English. (and my english is not sooo good !).
>
> The script uses the SME signal-events to create USERS, IBAYS
> and GROUPS
> on both Servers. But the HOMES and IBAYS created at Server A
> not visible at
> Server B. Not visible means they are physicly there but "not
> browseble".
> Also you will have a new Pannel whitch will show you what is
> visible at Server A and not at Server B. ( This work vice and
> verse ).
> The only thing you have to look is that this should be done
> on a fresh installed
> SME to prevent a mix between the UID and GID.
> (I could not revsole this problem now.)
>
> If somebody else is interested in let me know and i will send
> it to you or place it somewhere for download.
>
> Michael