Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I noticed today that my debian installation has set all the directories off of / to 755. Is this good? Any user of my system is able to FTP in and download almost anything. I'd like to change this, but I'm not sure what programs need these permissions, if any.
Also, I'm using apache and "public_html" home directories in the user accounts which have to be set to 701 for the web server to be able to view them and the files have to be at least 604, I think, but this also enables any other user to enter another user's public_html directory and download files if they know the file name. Is there a way to avoid this?
755 permission with a directory just means that non-root people can enter the directory and ls the contents. The permission of the file itself dictates whether they can read/delete/edit/execute it.
I understand how directory and file permissions work - what I'm saying is the files themselves are set to readable as well. What I don't know is if they have to be set this way for daemons and other processes to read them. For instance my /etc/passwd file is 644.
As far as the web files are concerned, they do have to be readable so that the web server can read them, but it seems this means any other user can through the file system as well.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771
Rep:
The way I would do this is create a group, add the webserver user ( nobody, if you're running apache out of the box ) to that group. chgrp the files that need to be access controlled to that group. Now change permissions on the folders to 750 and files to 640. I'm assuming that the users here own their files, so they get their permissions from the 'owner' set of permissions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.