Re: replicating /etc/passwd on a failover machine

2006-12-22 Thread stas khromoy
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

thanks for the help guys !

Jerry McAllister wrote:
 On Wed, Dec 20, 2006 at 11:28:27AM -0500, stas khromoy wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 hey folks

 we are working on building a failover server.
 now everything is going along pretty nicely. (knock on wood)

 so the question of the day.
 is there a way to replicate the password files ?

 i doubt that just copying over /etc/passwd and master.passwd will work .
 
 Almost.   You just need to make sure database stuff is updated properly.
 Check out pwd_mkdb(8) and vipw(8) and man master.passwd and man passwd.
 
 jerry
 
 thanks
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBRYwRJNbpM15f9s9nAQI4fQP9FR2s+YClP9fWLN1uBHH/0gBr6zl2ai6S
tIMNCav8rfj+xZlWJiN723WBp5U9O3msv7edHD1jPUfkVblZOp096jI976nYfE1D
vVvaQ5qAtTk3zJ/SsgKkusOIG6J1WCmif+WY26VBEkHLLkIvUI3AeCPyygRtbdyv
Kg4YsT4IlJk=
=IlD/
-END PGP SIGNATURE-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


replicating /etc/passwd on a failover machine

2006-12-20 Thread stas khromoy
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

hey folks

we are working on building a failover server.
now everything is going along pretty nicely. (knock on wood)

so the question of the day.
is there a way to replicate the password files ?

i doubt that just copying over /etc/passwd and master.passwd will work .

thanks


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBRYlkq9bpM15f9s9nAQKnRwP/ZXN9rExeMteW6GW60a1sECMgoxJ+s0lv
v3BrIWKoqV+seWs1yPTJx8y4k46ji55wMbWHwKy3tK0d1Ok/uaJRkS8NYlcQxJJo
UgDwW+sAovyG7QpLCGMJp5qCSYii1WPGa/O1NOzMjKerVIpT7AuO5s5nXWd0hg1S
JuQnoqLNhL8=
=MXb4
-END PGP SIGNATURE-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: replicating /etc/passwd on a failover machine

2006-12-20 Thread Bill Moran
In response to stas khromoy [EMAIL PROTECTED]:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 hey folks
 
 we are working on building a failover server.
 now everything is going along pretty nicely. (knock on wood)
 
 so the question of the day.
 is there a way to replicate the password files ?
 
 i doubt that just copying over /etc/passwd and master.passwd will work .

Actually, it's not much harder than that.  The only step you're
missing is running pwd_mkdb on the files after they've been
copied, you can easily add that to your failover process.

Although, it may be worthwhile to investigate kerberos or LDAP if there's
any chance at all that this might grow into a larger desire to replicate
user accounts.

-- 
Bill Moran
Collaborative Fusion Inc.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: replicating /etc/passwd on a failover machine

2006-12-20 Thread Beech Rintoul
On Wednesday 20 December 2006 07:28, stas khromoy wrote:
 hey folks

 we are working on building a failover server.
 now everything is going along pretty nicely. (knock on wood)

 so the question of the day.
 is there a way to replicate the password files ?

 i doubt that just copying over /etc/passwd and master.passwd will work .

It will work fine as long as you run pwd_mkdb after copying or changing any of 
the files. Also, you can use vipw to edit the list. It runs pwd_mkdb after 
you write and exit. See the relevant man pages for more info.

Beech

-- 
---
Beech Rintoul - Sys. Administrator - [EMAIL PROTECTED]
/\   ASCII Ribbon Campaign  | Alaska Paradise Travel
\ / - NO HTML/RTF in e-mail  | 201 East 9Th Avenue Ste.310
 X  - NO Word docs in e-mail | Anchorage, AK 99501
/ \  - Please visit Alaska Paradise - http://www.alaskaparadise.com
---













pgpOWUclG4h7e.pgp
Description: PGP signature


Re: replicating /etc/passwd on a failover machine

2006-12-20 Thread Kirk Strauser
On Wednesday 20 December 2006 10:28 am, stas khromoy wrote:

 i doubt that just copying over /etc/passwd and master.passwd will work .

You'd also need to pick up /etc/{s,}pwd.db - the compiled versions of those 
files.
-- 
Kirk Strauser


pgplg6wDlyMbY.pgp
Description: PGP signature


Re: replicating /etc/passwd on a failover machine

2006-12-20 Thread David Newman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/20/06 9:06 AM, Kirk Strauser wrote:
 On Wednesday 20 December 2006 10:28 am, stas khromoy wrote:
 
 i doubt that just copying over /etc/passwd and master.passwd will work .
 
 You'd also need to pick up /etc/{s,}pwd.db - the compiled versions of those 
 files.

Dunno if this works on FreeBSD, but with OpenBSD I have successfully
copied accounts between machines like this:

1. Run vipw on both machines and copy and paste the user accounts. vipw
works like vi.

Note that this step assumes the same environment exists on the source
and destination machines. If, for example, a user's shell is bash on the
source machine, then /usr/local/bin/bash must exist on the destination
box as well.

2. Copy and paste the relevant user groups from /etc/group. If users are
members of other groups (e.g., wheel), ensure that info matches as well.

3. On the source machine, run:

rsync -avz /home/username/ destination_machine:/home

This will move username's home directory over, preserving ownership and
permissions for all directories and files. Note the trailing slash on
the source directory.

This probably needs to be run as root, which means that at least
temporarily you need to go into the destination machine's
/etc/ssh/sshd_config and add this line:

PermitRootLogin yes

and then restart sshd like this:

kill -HUP `cat /var/run/sshd.pid`

If you don't normally want ssh access for root, be sure to undo that
change in sshd_config once you're done.

dn

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFiX6hyPxGVjntI4IRAs6PAKCk1YP2cKYWx70NxU5ZiOQyFtgHLACffFIH
27pgxgkQ+CYOaBJWD3n/2MQ=
=nMBm
-END PGP SIGNATURE-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: replicating /etc/passwd on a failover machine

2006-12-20 Thread Robin Vley

Kirk Strauser wrote:


i doubt that just copying over /etc/passwd and master.passwd will work .
You'd also need to pick up /etc/{s,}pwd.db - the compiled versions of those 
files.


I just read in another post that you can compile them using pwd_mkdb, 
that was news for me. I just want to confirm that just copying (rsyncing 
in our case) the .db files works just fine.


We do it to a mirror of our webhosting platform, all logins work just 
fine on the mirrored machine.


--
Robin Vley
F/X Services Managed Hosting
http://www.fx-services.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: replicating /etc/passwd on a failover machine

2006-12-20 Thread Jerry McAllister
On Wed, Dec 20, 2006 at 11:28:27AM -0500, stas khromoy wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 hey folks
 
 we are working on building a failover server.
 now everything is going along pretty nicely. (knock on wood)
 
 so the question of the day.
 is there a way to replicate the password files ?
 
 i doubt that just copying over /etc/passwd and master.passwd will work .

Almost.   You just need to make sure database stuff is updated properly.
Check out pwd_mkdb(8) and vipw(8) and man master.passwd and man passwd.

jerry

 
 thanks
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]