Locked myself out of my home
Well, this is embarrassing. I was trying to give Apache access to a directory in my home, and did a recursive chmod and chown command on my home directory. Now I can't even access it after recursively setting everything back to 664 and as my user/group.
Questions:
Code:
[Michael@devserver home]$ pwd |
Have to have the execute bit set on directories. So usually 0755 or 0775 for directories.
|
Code:
chmod -R u+X /home/Michael Also if there are any executables anywhere in your home directory, you'll need to manually re-add execute permissions on each and every one of them individually. Manually setting the octal permissions recursively for an entire directory structure is very rarely the right course of action. It usually causes far more problems than it potentially solves. Use the ugo +/- rwxX arguments to chmod instead. |
Thanks szboardstretcher, Well I feel silly.
To set things back to right, should I first make /home/Michael 700 recursively, then make /home/Michael 770 not recursive, and then make subdirectories either 750 or 770 on a as needed basis? |
Yeah. To start you can 'chmod 0775 /home/Michael'... then if you want to start to fix the Michael directory and its contents,..
As root you could chmod directories, files and scripts correctly with the commands below. You might still have some outliers to fix - like .ssh as mentioned. Code:
find /home/Michael -type d -exec chmod 0755 {} \; |
Quote:
Code:
~/.ssh/ Code:
$ chmod 700 ~/.ssh |
All times are GMT -5. The time now is 09:34 PM. |