Need to ( re-chown /etc )

Jon Radel jon at radel.com
Wed Oct 1 03:14:04 UTC 2008


Mike Price wrote:
> I needed to edit the /etc/pf.conf so I accidentally typed: chown -r /etc
> Can someone please help me with a command to change /etc back to the way it
> was?

Did Kevin Kinsey's suggestion not work?  It would be helpful if you gave
some hint as to why you're asking this again.

However, you should realize that you destroy information when you change
all the ownership information to a uniform value.  You need to:

1)  Know what the value for each file was so you can set it back, or
2)  Use your backups, or
3)  Check what the standard files are set to in the distribution (as
Kevin suggested), or
4)  Know that most, but not all, files in /etc are user root and group
wheel, use those values, and hope for the best.

In other words, there really isn't "a command" to fix the damage you've
done.

However, as I'm sure you realize by now, recursively destroying
information in or about system files tends to be a bad idea.  As is, as
a general rule, using chown as a privileged user just so that you can
edit a file such as this as an unprivileged user.

--Jon Radel
jon at radel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3283 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20081001/ec06487f/smime.bin


More information about the freebsd-questions mailing list