Page 1 of 1

Control access to directory and CGI

Posted: Mon Jun 27, 2005 12:29 pm
by jolinar
Sorry about this but I'm asking 2 different questions:

1) How do you limit access to directories

I have some php files stored in a directory "includes", I don't want anybody to be able to get in and have a look at the files. Can anyone suggest some ways of going about this?

2) How do you set up cgi on fedora

my php has been working fine as an apache module, but on my apache setup (fectory installs of php and apache on fedora core 3) I waswondering how I could set up php to run as cgi-bin as many people I know say that cgi is supposed to be more secure

Posted: Mon Jun 27, 2005 7:27 pm
by Chris Corbyn
Since you're talking about fedora I'm gonna assume you're wanting to restrict access on a *nix.

Restricting access to all but yourself....

In a console as the owner of the folder you wish to protect...

Code: Select all

-bash -$ chmod g-rwx foldername
-bash -$ chmod o-rwx foldername
-bash -$ ls -l ./
1 files
drwx------  10 d11wtq nobody     312 2005-06-18 15:46 foldername
-bash -$ _
Which means:

1. Remove read/write/execute permissions from the group (chmod g-rwx)
2. Remove read/write/execute permissions from everyone else (chmod o-rwx)
3. Check you (the owner) still has permissions and nobody else does (ls -l)

The second question... never done it and I dont have a fedora si I can't help you ;)