Password file migration help

Vince jhary at unsane.co.uk
Wed Jan 30 11:29:43 PST 2008


Sean Murphy wrote:
> I have a FreeBSD 5.4 system and would like to migrate users in the 
> password file with UIDs 3000 through 5000 to a FreeBSD 6.3 system on a 
> running on a separate box.  Is there a way to export just those users?
> 
hmm very roughly just a
for uid in $(jot 2001 3000); do grep $uid /etc/master.passwd > 
accountstokeep.txt ; done
should extract the accounts from the old server (no error checking 
though so if any other account has a gid in the range 3000 to 5000 it 
will also be caught.

Then in theory
cat accountstokeep.txt >> /etc/master.passwd
followed by
pwd_mkdb -p /etc/master.passwd
should be enough.

Again care should be taken that there are no conflicting accounts 
already in the /etc/master.passwd file.
(a quick
for uid in $(jot 2001 3000); do grep $uid /etc/master.passwd ; done
on the new machine before adding to it should give you a quick check.)

dont forget to ensure shells and home directories are available as needed


Vince

> Thanks
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at freebsd.org"



More information about the freebsd-questions mailing list