Re: Password file migration help



On Wednesday 30 January 2008 21:03, 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?

I'd probably sort /etc/master.passwd and pipe through awk:

sort -t ':' -k3,3n /etc/master.passwd | \
awk -F ':' '$3 ~ /^3[0-9][0-9][0-9]/, $3 ~ /^5/ { print }'

This will sort /etc/master.passwd numerically on the third field, uid, and
then give you all the lines starting with the first one where the uid is a
3 followed by at least three digits, up to and including the first one after
that where the first digit of the uid is a 5.

If you capture the output you should be able to merge it on the new host.

Jonathan
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: perl intersect problem
    ... the output password file. ... sub Sort { ... next if $seen{$uid}++; ... instead of calling split twice ...
    (perl.beginners)
  • Re: perl intersect problem
    ... the output password file. ... disappearance but always the same few users are filtering. ... In the Unix password file format the user name has to be unique however the UID need not be so it is possible that two or more users have the same UID. ... sub Sort { ...
    (perl.beginners)
  • Re: perl intersect problem
    ... Off hand I think that would only happen if the user name or the uid ... to rewrite your loop more compactly and avoid duplicate calls to ... #this function does not sort anything so Sort is a bad name ... #also Perl functions don't normally have uppercase letters ...
    (perl.beginners)
  • Re: Migrating me from linux/bsd to zOS
    ... I assume "uid" is schematic, ... The JCL example does nothing of the sort. ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: commit 7e92b4fc34 - x86, serial: convert legacy COM ports to platform devices - broke my
    ... But maybe we could change PNPACPI to sort by them if ... It should sort devices with the ... because my devices are already ordered by _UID by default. ...
    (Linux-Kernel)