cut -d : -f 1,6 /etc/passwd > users.sh

then you'll have a file like this: 
drue:/home/drue
blah:/home/blah
foo:/home/foo
bar:/home/bar

Remove lines that are not valid users.

Then, in vim:
:%s/^/chown -R /g
:%s/:/ /g

You'll have a file now like this: 
chown -R drue /home/drue
chown -R blah /home/blah
chown -R foo /home/foo
chown -R bar /home/bar


Basically you can just run that file, then, to set groups. 

Edit it again and
:%s/chown/chgrp/

And run it again.  

Easy enough?  I'm sure others can consolidate some steps.  For instance,
you could run that first command through sed to do a lot of the regular
expression work.  But realistically this is how i'd do it.  

Ah what the heck, just for fun: 

cut -d : -f 1,6 /etc/passwd | sed 's/^/chown -R /' | sed 's/:/ /' > users.sh 

Also make sure to edit out system accounts before running users.sh.

Dan

On Thu, Apr 21, 2005 at 10:37:44AM -0500, Raymond Norton wrote:
> We managed to rescue all the home folders, and user info files from our
> server that crashed. We have copied them over to a new Fedora core 3
> install. Is there a script I can run that can give the users in
> /etc/passwd full control of their original home folder. As of now, only
> root has permission to access them.
> 
> 
> Raymond
> 
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list