LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-31-2004, 06:17 PM   #1
Drogo
Member
 
Registered: Oct 2002
Distribution: RedHat 8 or 9 (shrike)- Fedora Core 1,2
Posts: 215

Rep: Reputation: 30
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 ?
 
Old 01-31-2004, 07:32 PM   #2
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
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.
 
Old 01-31-2004, 07:38 PM   #3
Drogo
Member
 
Registered: Oct 2002
Distribution: RedHat 8 or 9 (shrike)- Fedora Core 1,2
Posts: 215

Original Poster
Rep: Reputation: 30
Is there a way to turn off Permanently the directory listing from every folder i create ?
 
Old 01-31-2004, 09:11 PM   #4
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
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.
 
Old 01-31-2004, 09:18 PM   #5
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
In your httpd.conf fine - try adding Options 'Indexes None' in your DocumentRoot, although this won't stop ppl from guessing URLs
 
Old 01-31-2004, 10:05 PM   #6
Drogo
Member
 
Registered: Oct 2002
Distribution: RedHat 8 or 9 (shrike)- Fedora Core 1,2
Posts: 215

Original Poster
Rep: Reputation: 30
i try that and it didn't do anything...
 
Old 01-31-2004, 10:24 PM   #7
YMHiK
LQ Newbie
 
Registered: Jan 2004
Distribution: Slackware 2.6.5, Slackware 2.6.4, RedHat 9 2.4.20-8
Posts: 23

Rep: Reputation: 15
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' .
 
Old 01-31-2004, 11:03 PM   #8
Drogo
Member
 
Registered: Oct 2002
Distribution: RedHat 8 or 9 (shrike)- Fedora Core 1,2
Posts: 215

Original Poster
Rep: Reputation: 30
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP users prevent browsing to other directories mephesto Linux - Software 2 05-07-2005 10:03 AM
prevent users from running 'su' manudath Linux - Security 5 04-28-2005 02:03 PM
Can I prevent users from seeing dir contents? Jukas Linux - Newbie 5 04-08-2005 07:56 PM
Prevent users from running su Itzac Linux - Security 13 03-25-2003 04:25 PM
prevent users from accessing KDE or GNOME cyberswami Linux - Security 6 01-24-2003 01:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration