• Welcome to Free PC Help, a free PC Help forum to get help with your computer problems.

    Free PC Help is a community that offers free computer help and support for all users, all ages, worldwide.

    In order to start asking questions or contribute on someone else's post you will first need to register. Don't worry - it's quick and easy and once you have registered you will have instant access to the entire forum.

    If you do decide to join the forums you will not have the option to send Private Messages [ PMs ] or add a Signature until you have made 5 posts or more. This is an attempt to try to stop Spammers using the PM system or adding links to their Signature.

Changing permissions with chmod

kthdsn

FPCH Member
Joined
Jan 21, 2006
Messages
15
Location
UK
#1
I'm having some problems with permissions in apache's document root. I set up all the folders to 777 and files to 644, but when I checked them recently I seem to have some files with 777 and that can't be good.

I'm not too good with terminal commands, is there a nice easy way I can use chmod to sort it all out for me without having to go through and change them all separately?

Is there an easy way to make sure new files I create end up with the right permissions, or do I have to check them as I go?
 

Jamey

FPCH Member
Joined
Jan 21, 2006
Messages
333
Location
Telford, UK
#2
I think it's "chmod -R" or with an -r switch somewhere in it. You can find out the available switches by doing "chmod -h" or "chmod --h" (same for any command). The 'r' stands for recursive, so you could use it on your docroot.

I think if you create a new file with gedit it should inherit permissions of 644, since that's the 'normal' way. Why do you want 777, not that I really have much of a clue as to what the difference is right now? Isn't that everyone can read, write and so on? I wouldn't give anybody any more permissions, or any file I mean, than it needs.
 

kthdsn

FPCH Member
Joined
Jan 21, 2006
Messages
15
Location
UK
#3
644 is read for everyone and write for me, but i need folders to have execute permissions in order for apache to serve what is in them. I was advised by someone on ubuntu forums to use 777 on folders. The thing is if I use chmod -R (which I did before) I then have to go back and change all the folders. Is there not an easier way lol.