Re: Password file migration help

2008-01-31 Thread Mel
On Wednesday 30 January 2008 20:26:20 Vince wrote:
> 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

That's a bit loose, and forgot a dash. The following should really only get 
the uid's (not the gids, parts of a password, comments and what not):
for uid in $(jot - 2001 3000); do \
grep -E "^[^:]+:[^:]+:$uid:" /etc/master.passwd;
done

This doesn't migrate home dirs, but using the above and piping to:
cut -f 9 -d ':'
should give you a list of home dirs to work with.
-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Password file migration help

2008-01-31 Thread Kemian Dang

Sean Murphy 写道:
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?


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

awk -F: '{if($4 > 3000) if($4 < 5000) print $0}' /etc/master.passwd

You should do it as root.

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


Re: Password file migration help

2008-01-30 Thread Jonathan McKeown
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@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Password file migration help

2008-01-30 Thread Vince

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@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
"[EMAIL PROTECTED]"


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


Re: Password file migration help

2008-01-30 Thread Paul A. Procacci

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?


Thanks
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
"[EMAIL PROTECTED]"
Open vi/vim/etc on both machines via `vipw`, and copy 'n' paste.  Repeat 
for the group file in necessary.

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


Re: password file migration

2007-06-15 Thread Ofloo

I did the same thing a long time ago and i just created used pwd_mkdb, and it
worked fine.

Though i'm not entirely sure what this has to do with this topic.


Mark Messier wrote:
> 
> 
> I know this has been covered before, but the search mechanism
> at the mailing list archive doesn't seem to work (zero matches for
> the word: password).
> 
> I've got a 5.3 system and a 6.2 system.  I want to migrate the user
> accounts from the 5.3 to the 6.2.  They use different encryption
> mechanisms for the password in master.password.
> 
> Other that running a cracker, is there a way to upconvert the
> old to the new?
> 
> Thanks,
> -mark
> 
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "[EMAIL PROTECTED]"
> 
> 

-- 
View this message in context: 
http://www.nabble.com/6to4-IPv6-problems-FreeBSD-6.2-p4-tf3829352.html#a11134620
Sent from the freebsd-questions mailing list archive at Nabble.com.

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


Re: password file migration

2007-06-15 Thread Garrett Cooper

Ofloo wrote:

I did the same thing a long time ago and i just created used pwd_mkdb, and it
worked fine.

Though i'm not entirely sure what this has to do with this topic.


Mark Messier wrote:
  

I know this has been covered before, but the search mechanism
at the mailing list archive doesn't seem to work (zero matches for
the word: password).

I've got a 5.3 system and a 6.2 system.  I want to migrate the user
accounts from the 5.3 to the 6.2.  They use different encryption
mechanisms for the password in master.password.

Other that running a cracker, is there a way to upconvert the
old to the new?

Thanks,
-mark

   Simply running mergemaster (part of the recommended upgrade errata) 
should do the trick, as it will prompt you to execute some commands to 
'upgrade' the password database and other relevant databases.

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


Re: password file migration

2007-06-14 Thread Kris Kennaway
On Thu, Jun 14, 2007 at 02:57:41PM -0700, Mark Messier wrote:
> 
> I know this has been covered before, but the search mechanism
> at the mailing list archive doesn't seem to work (zero matches for
> the word: password).
> 
> I've got a 5.3 system and a 6.2 system.  I want to migrate the user
> accounts from the 5.3 to the 6.2.  They use different encryption
> mechanisms for the password in master.password.
> 
> Other that running a cracker, is there a way to upconvert the
> old to the new?

They are backwards compatible formats, so why do you want to change?

If you are concerned that the old password hash is insecure (if it's
an ancient DES password, this is true), then you will need to generate
a new password for each affected account.  One way to do this is by
using password expiry to force a change on next user login (see
e.g. pw(8)).

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