Today I ran
sudo chmod -R a-wrx /. Now nothing is working. Can anyone help me recover my system?
Today I ran
If you are comfortable with scripting you could:
Or of course a clean install is possible.
BTW: Who told you to issue that command?
More Information (edit)
I actually just found a really nice script that uses the same logic. As the author says, be careful before using it and don't if you are not sure you know what it does: http://superuser.com/questions/132891/how-to-reset-folder-permissions-to-their-default-in-ubuntu-9-10
To help you on the way (from the source mentioned above):
I would almost say that you might have to do a clean re-install here. There are many iterations of directories off of the system root that are required for Ubuntu (Linux) to run properly. If their permissions are messed-up, you will need to re-chmod everything. That's assuming of course that it even lets you log back in.
If you wanted to try to recover, you may be able to accomplish this as the root user. To get in as root, reboot and hold SHIFT immediately after BIOS posts. That should get you into your GRUB menu.
From the GRUB menu, select your most recent kernel tagged with "(recovery mode)." Once that finishes loading, you should be presented with a menu that has an option to "drop to root shell prompt."
If it works and logs you in as root, you should be able to