CHMOD Big Oops!

Frank Sorenson frank at tuxrocks.com
Wed Oct 25 08:36:56 MDT 2006


David D Turley wrote:
> Ok, lets say I "accidently" executed the command:
>  
> chmod -R 777 .
>  
> from the root directory.  What do I need to do to re-secure my system and
> undo this big oops?  
>  
> System: Debian - Etch
>  
> Thanks!
>  
> Dave

I'd look into writing something that takes the output of:
rpm -qa --queryformat "[%{FILENAMES} %{FILEMODES:perms}\n]"

which looks like this:
/usr/share/a2ps/encoding/iso1.edf -rw-r--r--
/usr/share/a2ps/encoding/iso10.edf -rw-r--r--
/usr/share/a2ps/encoding/iso13.edf -rw-r--r--
...

and fixes the permissions as necessary.

Oh, wait.  You've got Debian?  Well, since .deb is so much better than 
rpm, I'm sure there's an equivalent functionality.

Frank



More information about the PLUG mailing list