I accidentally used
sudo chmod 3 /
which gives a execute and write permission to the root directory, while deleting the read permission. How can I recover from this, I cannot even use sudo
now.
chmodpermissionsroot
I accidentally used
sudo chmod 3 /
which gives a execute and write permission to the root directory, while deleting the read permission. How can I recover from this, I cannot even use sudo
now.
Best Answer
First, try other suggestions while still logged in, because mine requires a reboot. If you see that no other attempt works, you should reboot and start a live DVD/USB session.
Mount the root partition and edit the
/etc/fstab
as root. You will need to run a command similar to this:Please adjust the path to the correct mount point you used.
In the file, locate the line belonging to the root partition, it should look similar to the following:
Try to enforce "universal" permissions by adding the proper parameter:
Reboot and try to log in again. You should be able to fix the permissions with:
Warning
After the fix, remember to revert the changes made to
/etc/fstab
, otherwise anyone will be able to access and modify every system file.