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.


Version: GnuPG v1.4.3 (Darwin)

freebsd-questions@freebsd.org mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to