This is a very common error for people coming from an OS that lack the permission concept. Many
sudo chmod -R 777 /
and such have been issued with perhaps good intentions, but it is also more or less the one user error that could make me recommend "just reinstall" for a *nix system.
If you just
chmod -R 755, then you will among other things give read and execution permission to every file for anyone. If one just removes execution for every file (directories need it to be browsable), then one will remove the execution bit for some files that were supposed to be executable, and so on.
In this case it is perhaps not as severe as
-R /, but in e.g.
/var/log there are many files that are not supposed to have read permissions for anyone. A small excerpt:
This is not trivial to restore. And that was just one directory.
All in all: even if you did make SSH work again, you have had some not trivially repairable permission information loss. If it concerns a strictly personal server, the consequences are probably not that dire, but the permissions are set as restrictive as possible for a reason. In e.g. the log files I mentioned above, sensitive information may be stored, and now it is enough for an exploit with gives regular user rights to find this out and gain even more information for root permission attacks.
I last saw someone give the "Do
chmod -R 777!!!" tip yesterday on a local forum. Don't trust the internet! :-)