0

I want to make file/folders password protected in Linux(Centos) using htpasswd. I have done following:-

root@ cd /mnt/Recordings/CONF (I have Changed the directory)

CONF@ htpasswd -c .htpasswd xxxxx

CONF@ pwd
/mnt/Recordings/CONF

CONF@ vim .htaccess

AuthUserFile /mnt/Recordings/CONF/ .htpasswd
AuthName "Enter Password"
AuthType Basic
AuthName "Protected Context"

<Limit GET POST>
require valid-user
Require python
</Limit>

I'm not able to create password protected file/folder in Linux("front end"/"command prompt"/"web based"). I got following error:

[Wed Jan 08 17:38:57 2014] [alert] [client xxx.xxx.xxx.xxx] /mnt/Recordings/CONF/.htaccess: Invalid auth file type: .htpasswd

user2932003
  • 171
  • 2
  • 4
  • 14
  • Does your AuthUserFile contain a typo? Perhaps check AuthUserFile "/etc/htpasswd/.htpasswd" (no space, in quotes). – emsworth Jan 08 '14 at 14:18

1 Answers1

0

Try Following code in the htaccess file:

AuthUserFile "/mnt/Recordings/CONF/.htpasswd" AuthType Basic AuthName "My Secret Folder" Require valid-user Satisfy any Order deny,allow Deny from all

Komalkumar
  • 11
  • 1