I accidentally changed access rights on / for my Ubuntu 16.04 using sudo chmod 466 /. I was supposed to change access rights for a file but instead I accidentally executed a chmod on / (root directory). Of course now I can't access the operating system and I would like to recover some files from it.
Is there a way that I can change access rights for / again so that I may recover my operating system and the files stored within it? If not is there at least a way that I can recover my files from it before I reinstall the entire system again?
I tried pressing F2 to enter the terminal before the system tries to load (since it can't load now, or at least the graphical UI won't load), and then logging in but since the permissions now don't allow write or execute it says that I don't have permissions to access it. I also tried executing a chmod 777 / while in terminal but that didn't do much good either, or maybe I did something wrong there... I tried looking for an answer to this question online but all I can find is how to chmod specific files and directories within the system.
The system is encrypted and all I am able to do now is to decrypt the disk before the system starts to load, but after that I can't do much. If anybody could help me with this it would be much appreciated.
-- Update -----
Ok, so this is where I am at right now:
I used a USB with a live Ubuntu system on it by clicking on the Try Ubuntu option and then using the terminal to change permissions for / of my system with sudo chmod 777 -R for the hard disk where my Ubuntu OS is installed. Now I can log in to the system again but now when I log in all my settings are gone and I can't access my files. It's like accessing a fresh installation of Ubuntu 16.04 even though I didn't install the system again. I just used the option Try Ubuntu from the live Ubuntu USB.
When I try to access my home directory which was also encrypted I can't see my files. All I can see are the default directories like Desktop, Documents, Downloads, Music, Pictures, Public etc. but the directories that I created are no longer there. There is a file though called "Access-Your-Private-Data.desktop" and when I click on it it launches a Terminal and asks form my login password. After I type in my login password nothing happens and I still don't see a new directory with all my files that were encrypted in my old home directory or anything like that. Can anybody help me out with this? How can I recover my files from that directory?
mount -o rw,remount /
to remount / as writeable, then issuechmod 755 /
to restore permissions. Then reboot and see if that helps. – Jeffrey Ross Jul 07 '16 at 09:12