[6262] in RedHat Linux List
Re: Permissions
daemon@ATHENA.MIT.EDU (Steve \"Stevers!\" Coile)
Tue Nov 26 14:48:55 1996
Date: Tue, 26 Nov 1996 14:29:34 -0500 (EST)
From: "Steve \"Stevers!\" Coile" <scoile@patriot.net>
To: Skull <skull@yakko.cs.wmich.edu>
cc: redhat-list@redhat.com
In-Reply-To: <3.0.32.19961126134653.00694618@141.218.40.78>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
On Tue, 26 Nov 1996, Skull wrote:
> >On Tue, 26 Nov 1996, Skull wrote:
> >
> >> >I just set up a new mail server under the 2.0.0 redhat kernel. I moved
> >> >my entire passwd file over from another machine and need to change the
> >> >permissions around.
> >>
> >> >Does anyone know the how to do a mass change owner where all four hundred
> >> >clients get changed to the right ownership.
> >
> >The change ownership of the users mail directories. The spool mail will
> >have to be done as well. I just don't want to go in and change each
> >individual account, I want to do a mass change ownership to make each
> >owner the correct one when dealing with their individual accounts.
#!/bin/sh
# USE AT YOUR OWN RISK
awk -F : '$3 > 99 {print $1,$6}' /etc/passwd > /tmp/users$$.dat
exec < /tmp/users$$.dat
while read username homedir
do
[ -d $homedir ] && chown -R $username $homedir
[ -f /var/spool/mail/$username ] \
&& chown $username /var/spool/mail/$username
done
rm /tmp/users$$.dat
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
________________________________________________________________________
http://www.redhat.com/RedHat-FAQ http://www.redhat.com/RedHat-Errata
http://www.redhat.com/RedHat-Tips http://www.redhat.com/mailing-lists
------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null