Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache Directory Authentication Problem 1

Status
Not open for further replies.

djabell

Instructor
Apr 9, 2001
44
GB
I'm quite new to Linux, so if this is really simple then I apologise!!

I've created a number of directories (Group1, Group2, etc) and I want to force users to enter a valid username and password before they can access the files in the directories. However, each user can only access their own directory (user 'Group1' can only access the directory 'Group1', etc.). Do I need a seperate .htaccess and .htpasswd file for each directory? Also, can anyone tell me what I should put in the .htaccess file?

Ta.
 
I am no expert - but for what its worth...
You need an .htaccess file in each directory.
You only need one .htpasswd file.
In the .htaccess file you need...

AuthUserFile /whereveritis/.htpasswd
AuthGroupFile /dev/null
AuthName ProtectedDirectoryOrWhatever
AuthType Basic

require user yourUserName

You can also define user groups, and limit what your users can do... go to somewhere like Google and search on 'htaccess' for a wealth of more detailed info.
Good luck.
Jub
 
Hey, thanks! I've managed to just about sort it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top