[Discuss] su stopped working
Murray Strome
wmstrome at shaw.ca
Mon Oct 16 10:36:22 PDT 2006
pw wrote:
> pw wrote:
>> 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
> ERRATA:
>
> find * -printf "%h/%n|%#m|%g\n" | grep root > text.txt
> forgot the newline ^^
>
>
> Peter
Thanks -- I will try that sometime soon. My wife's computer has the same
distribution.
Murray
More information about the Discuss
mailing list