Questions tagged [.htpasswd]

.htpasswd is a flat-file used to store usernames and password for basic authentication of Apache HTTP Server.

.htpasswd is a flat-file used to store usernames and passwords for basic authentication on Apache HTTP Servers. The name of the file is given in the .htaccess configuration, and can be anything, but ".htpasswd" is the canonical name. The file name starts with a dot, because most Unix-like operating systems consider any file that begins with dot to be hidden.

This file is often maintained with the shell command htpasswd which can add, delete, and update users, and will properly encode the passwords for use (so they are easily checked, but cannot be reversed back to the original password).

The file consists of rows. Each row corresponds to a username and hashed password pair, separated with the colon. For example:

user:password

The hashed password is typically "UNIX crypt" style, encrypted in either MD5 or SHA1 as common alternatives.

Additional users can be added by using the htpasswd shell command or by appending new lines to the file. For example:

user1:password1
user2:password2

Resources available on the Apache HTTP server can be restricted to users listed in the files created by htpasswd.

See also

526 questions
0
votes
1 answer

.htpasswd 500 error with correct full path

I need to protect my HTML-page (admin.html) with password and I'm using .htpasswd + .htaccess files As far as I understand, there is no need to write htmk containing flder in tag. But I've set full path to .htpasswd! So why do I get 500 error with…
Alex Sham
  • 489
  • 7
  • 14
0
votes
0 answers

How can set an htpasswd only for urls that match a pattern?

I want to set an htpasswd for all URLs that match a pattern. Specifically I want to set it for all URLs that start with '/admin.php?' except those which contain the string 'useradmin'. Is this possible?
Duncan Marshall
  • 530
  • 1
  • 6
  • 15
0
votes
1 answer

htaccess - htpasswd: different AuthUserFile depending on subdomain

It's been a couple of days looking at how I could manage to have different AuthUserFile paths depending on my subdomain. Why do I have this problem: The admin access of my site is protected by htaccess - htpasswd. I'm now managing the repo with…
FlorianB
  • 179
  • 1
  • 1
  • 11
0
votes
1 answer

Nginx basic HTML authentication on a subfolder

I need help applying basic HTML authentication to password protect a subfolder on my site - hosted by Digitalocean served using Nginx. I followed the tutorial -…
JeffA
  • 166
  • 1
  • 17
0
votes
1 answer

htpasswd a big list of user and pass

I got a script running on server , that generating a big file of user and password in format username ="johnuser" password="johnpass" username ="adamuser" password="adampass" so on about 500 in list This file is keep updating every 10…
0
votes
0 answers

Sub directory to ask for password not main directory

I have a folder which is in my public_html folder that I want to password protect. In that folder I have an .htaccess file which points towards a password file outside of the public_html folder. AuthType Basic AuthName "Please Log In" AuthUserFile…
0
votes
1 answer

Magento Image Upload HTTP Error only in firefox,

My web site in Magento ver. 1.7.0.2 , i am trying to upload the image using mozila firfox so get the "Upload HTTP Error" but in chorme it working.... I tried lot of solution like changing permission to the media folder,changed in .htaccess file and…
0
votes
1 answer

How to make a protected file list on my server?

I've a silly question. I did not create a protected list of folder and file on my server with htaccess. I've a folder protect with htpasswd. There is this in my htaccess : AuthType Basic AuthName "My Protected Area" AuthUserFile .htpasswd Require…
pierre521
  • 3
  • 3
0
votes
2 answers

How can I secure certain HTML pages with a password?

I like to create basic HTML websites. I know nothing about PHP, JavaScript, or any of that stuff. I wanted to make a special page that when you access it, it will prompt you a username and password, and will only grant access if this is correct. I…
garirry
  • 11
  • 2
0
votes
1 answer

htpasswd on all subdomains and prevent auth by different auth ip's

I want to all subdomains with *.domainname.com have got an httpasswd protect, but 2 ips allow to auth without credentials. AuthUserFile /home/www/.htpasswd AuthName "Acceso Privado" …
50l3r
  • 1,549
  • 4
  • 16
  • 27
0
votes
1 answer

How to restrict NGINX rewrite 'location' with auth_basic_user_file

I have the following location block in my NGINX server block: location ~ ^/admin { auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd; if (!-e $request_filename){ rewrite ^(.*)$ /index.php?uri=$1; } } But it doesn't…
richardgirges
  • 1,452
  • 1
  • 12
  • 17
0
votes
0 answers

Laravel 4 separate admin driectory htpasswd

I use Laravel 4, and I like to separate the admin area, to a different folder. I wnat this separation by phosocally, not only by filters, and route tricks. But I don't want to deal with two different laravel installation. I already use different…
NemoPeti
  • 79
  • 1
  • 7
0
votes
0 answers

Apache AuthBasic Module isn't working and recognized in Mamp

On my local system i tried to get password protecting a directory with .htaccess running on Mamp 3.0.7.2 . The Apache version Mamp uses is Apache/2.2.29 (Unix). The httpd.conf file /applications/mamp/conf/apache/httpd.conf contains the following…
rkoller
  • 1,424
  • 3
  • 26
  • 39
0
votes
1 answer

How to delete .htaccess and .htpasswd and where are these files so I can delete them straight away?

I have got XAMPP Version 1.8.3-4 and I am running this program in Mac. I want to delete this authentication mode but I can't find the .htaccess and .htpasswd files in my folder. Does anyone know where I can find it? I found out that after deleting…
Sandesh Rana
  • 81
  • 4
  • 13
0
votes
2 answers

Exclude HTTP authentication from specific Controller

I have an application made in CakePHP 2 that has a HTTP protection through .htaccess file. Already have an exception in a certain directory in webroot and works well. AuthType Basic AuthName "My Application" AuthUserFile…
Paulo Rodrigues
  • 5,273
  • 7
  • 35
  • 58