linux chmod -R 777 /var/

Paul Maas picture Paul Maas · Aug 15, 2013 · Viewed 36.2k times · Source

By mistake I give via ssh with root privelege a

chmod -R 777 /var/

in stead of

chmod -R 777 var/ for a var folder inside a home directory.

Now I cannot login again via ssh. I have a resque mode availble.

What to do? Does someone this?

Answer

Alma Do picture Alma Do · Aug 15, 2013

First of, twice check your input while in root mode. Then, you need to restore correct permissions in your ~/.ssh folder:

chmod 700 ~/.ssh
chmod 644 ~/.ssh/*

And, also, restore your permissions in /var directory as well:

chmod 755 /var/empty
chmod 755 /var/run