LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to prevent users from --> (https://www.linuxquestions.org/questions/linux-software-2/how-to-prevent-users-from-140824/)

Drogo 01-31-2004 06:17 PM

How to prevent users from -->
 
browsing some directories with browser..

Example if i have a directory that has a index.html with a images folder..
users can browse the images folder if there not index.html on it

Is theres anything else i can do so dont have to put a index.html on every directory i create ?

wapcaplet 01-31-2004 07:32 PM

Do you mean users on your local machine, or people using your webserver?

I think the regular permissions will let you do this... turn on 'read' access, but turn off 'execute' permission for the folder (chmod +r -x); people can still read the files in the folder, if they know the name, but they can't actually view a directory listing of it.

Drogo 01-31-2004 07:38 PM

Is there a way to turn off Permanently the directory listing from every folder i create ?

wapcaplet 01-31-2004 09:11 PM

I think there's a way to do it by setting your umask. Check out this thread. You can add a line to your ~/.profile like this:

umask 033

That will use a mask of octal 033, which just means that the read and execute bits for everyone except you (the owner) will be turned off by default.

mcleodnine 01-31-2004 09:18 PM

In your httpd.conf fine - try adding Options 'Indexes None' in your DocumentRoot, although this won't stop ppl from guessing URLs

Drogo 01-31-2004 10:05 PM

i try that and it didn't do anything...:(

YMHiK 01-31-2004 10:24 PM

Maybe it may help.
Usually such a behavior is reffered as "Directory Listing". And most httpd servers support it, so if you are not using an Apache you may need to refer to documentation for your particular httpd.
You can also create an empty file index.html.. by 'touch index.html' .

Drogo 01-31-2004 11:03 PM

Quote:

Originally posted by YMHiK

You can also create an empty file index.html.. by 'touch index.html' .

Im lost ..are u trying to say to add and empty html to each directory?

If yes

thats what im doing now and im looking for a different solution..because i have too many directories.

PS : I appreciate the replys guys..keep it coming.


All times are GMT -5. The time now is 06:00 AM.