[Discuss] su stopped working

pw p.willis at telus.net
Mon Oct 16 10:21:35 PDT 2006


Murray Strome wrote:
>  However, if I did accidentally
> use the chmod -R incorrectly, lots of things are probably incorrect. 
> Anyway to fix them without reinstalling?
> 
> Murray


Get someone you trust, who has the same distro,
to dump their system wide file permissions into a text file.

cd /

find * -printf "%h/%n|%#m|%g" | grep root > text.txt

ie:

/full/file/path/filename|nnnn|root

where 'nnnn' is the numeric file permission for each file.

Then just run a script against the files listed to change
permissions for each file.


cat text.txt | awk -F "|" '{print "chmod "$2" "$1}' > fix.sh

sh fix.sh


With a little tweaking you could also change the ownership of
files and directories if those are bad as well.


Peter


More information about the Discuss mailing list