So I accidentally ran
chmod -R 0777 /var and I need to revert that (let alone allow chmod the correct ssh directory so I can log back into it). I'm feeling screwed, can anyone help? The sooner the better, thanks.
migrated from stackoverflow.com Apr 6 '12 at 13:44
This question came from our site for professional and enthusiast programmers.
There is for var
drwxr-xr-x 21 root root 4096 Apr 6 2011 var
and for 'var/*' subfolders on my host (CentOS 6)
All your files are now executable as well in all subdirectories to
On my system, the few executable files below
If I had to restore the executable bit after
and then manually set
The lasting problem is security, but mostly if someone is able to log in as a regular user on the computer. If it's a single user system with a low threat level, you could probably keep going and just take it as a lesson. Had it been something else, a re-install would be the simplest way to fix everything.
Permissions are central in file handling on *nix. It's a quite destructive operation to completely wipe all of them on a fundamental directory tree; and thus quite difficult to restore as well.