Quantcast
Channel: Broken system after chmod -R 644 / - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by Gilles for Broken system after chmod -R 644 /

$
0
0

The good news is that all your data is still there. The mixed news is that your system installation may or may not be recoverable — it depends where chmod stopped.

You will need to boot into a rescue system to repair it. From the rescue system, mount your broken installation somewhere, say /mnt. Issue the following commands:

chmod 755 /mnt
find /mnt -type d -perm 644 >/mnt/bad-permissions
find /mnt -type d -exec chmod 755 {} +

The first find command saves a record of directories with bad permissions into a file. The purpose is to see where permissions have been modified. The second find command changes all directories to be publicly accessible.

You now have a system where all directories listed in /mnt/bad-permissions and all files in these directories are world-readable. Furthermore files in these directories are not executable. Depending on which files were affected, this may be easily repairable or not. See Wrongly set chmod / 777. Problems? for what you can try to get the system functional, to which you should add

chmod a+x /bin/* /sbin/* /usr/bin/* /usr/sbin/* /lib*/ld-*

But even if you manage to get something working, there's a high risk that some permissions are still wrong, so I recommend reinstalling a new system, then restoring your data. How do I replicate installed package selections from one Debian system to another? (Debian Wheezy) should help.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>