LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-01-2013, 12:53 AM   #1
dushyantgohil
Member
 
Registered: Aug 2011
Location: India
Distribution: Cent OS & Ubuntu
Posts: 107

Rep: Reputation: 3
creating password protected directory


Hi,

i want to create a password protected directory on my server, i have searched out many things for these on internet and i have got one thing is create .htpasswd file in the directory which i want to protect but its not working in my case.

Code:
AuthUserFile /home/<user_name>/html/.htpasswd
AuthGroupFile /dev/null
AuthName "Secure Area"
AuthType Basic
require valid-user

Thanks.
 
Old 03-01-2013, 05:54 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Actually, you put the .htaccess file there & the .htpasswd file somewhere safe that Apache can reach eg /etc/httpd/conf.
In any case, best practice is to forget .htaccess and put the directives in the relevant <Dir...> </Dir...> directives inside httpd.conf.

I'm assuming you are talking about using Apache to access the dir?
 
Old 03-01-2013, 07:52 AM   #3
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
Did you created /home/<user_name>/html/.htpasswd file and created users

htpasswd -c /home/<user_name>/html/.htpasswd <username>


Thanks
 
  


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
[SOLVED] How to create a password protected directory in a USB disk drive Vimuth Linux - Security 5 02-25-2011 01:32 AM
Software for creating and opening password protected ZIP achives the_gripmaster Linux - Software 3 08-27-2006 12:03 PM
Force https on a password protected directory abapdr Linux - Software 1 06-07-2004 04:35 AM
Password Protected Folder? crab_2004 Linux - Software 2 02-22-2004 10:50 PM
Password Protected Directories TheSockMonster Linux - Security 2 05-31-2002 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:06 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