chmod problem

SandManMattSH

Registered
Sorry guys, but I don't know of anywhere else to ask this. And I've always known this list to get good responses on development questions, so I figured maybe just this once, one of you might be able to help me with a technical question.
I was changing the permissions of everything in a directory inside my home folder recursively, and I meant to type "chmod 777 .a*", but I accidentally typed "chmod 777 .*". I stopped it in the middle of what it was doing right after noticing an error referring to a file it couldn't change the permissions of. It stopped while in the middle of changing permissions within the ~/Library directory.
Now everything in my home folder with a starting letter before "L" (i guess it was doing it in alphabetic order) has the permissions 777 (rwx for all users). Does anyone know of any way I can get back the defaults? Or of any way I can have the permissions reverted to the way they were less than 10 minutes ago?

also, i just want to make sure, but did "chmod 777 .*" change all files on my hard drive? or only those in my home folder?

I ran Disk Utility and tried to repair all permissions. It didn't find any problems. It apparently it thinks everything is perfectly splendid.

Note also that local security isn't an issue right now. I don't have anyone accessing my computer in any sort of a way that could cause a problem. My only problem is that I constantly connect to wireless networks and I believe that my current situation is a huge problem... Also, I run FTP, SSH, HTTP, and VNC servers off of this computer normally. I've just disabled these (except HTTP, which I can't afford to disable unless it is vital).

If anyone has any tips on how I can solve this problem without manually changing the permissions of ~120,000 files, and without reformatting, I would be FOREVER grateful. If anyone can solve this thing painlessly, I will be ecstatic.


~Matt
 
Not sure why you closed your own thread, but I just reopened it.

A chmod 777 .* is only going to chmod files that are ".*" in a given directory. So, I don't think you performed them on your entire drive as you imagine. If you did "chmod -R * at the root directory, then you would have issues.

But, only files beginning with a . in that one directory (not subdirectories) would be effected. To see those files, a "ls -al" command will show those "hidden" files.
 
Well, if it was attempting to change something in the Library directory, it must have been something more like "chmod -R 777 ./*"

I'm afraid there's no way of getting back your permissions. If you have a backup copy, you could look at that for reference, otherwise I guess just pick a default permission set, apply that, and then correct the differences individually.
 
Scruffy, that's not true, you should say there's no easy way of getting back permissions. He'd have to go through every file one by one to switch the permissions back is all.

By default, folders are created with the permissions 0755 (rwxr-xr-x) and files are created with the permissions 0644 (rw-r--r--). There may be some cases where the files/folders have more specialized permissions, but setting them this way at least stops anyone else from editing them.

And just to help out a bit:

.Trash has the permissions of 0700 (rwx------)
.bash_history (if you have it) is 0600(rw-------)
.ssh (if you have it) is 0700 (rwx------)

As was stated above, doing chmod .* should only change the permissions for files starting with a ., but in case you want to make sure:

Desktop is 0700 (rwx------),
Library is 0700 (rwx------),
Movies is 0700 (rwx------),
Music is 0700 (rwx------),
Pictures is 0700 (rwx------)

The rest have the default 0755 permissions.
 
Back
Top