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

.htaccess password protection breaks WP/Twitter feeds

Working on a site for a client who has a dev.sitename.com subdomain for development, which I just went in and password protected with .htaccess/.htpasswd files. Now, all the Wordpress and Twitter feeds are broken and giving "authentication failed"…
theflowersoftime
  • 2,546
  • 3
  • 24
  • 32
0
votes
1 answer

Remove htpasswd protection for a specific action

I have a website in cakephp 3 with htpasswd protection. I want to access specific action without password for e.g /apis/models I can remove password protection from specific file by putting the following code in webroot/.htaccess file but how can I…
Sehdev
  • 5,486
  • 3
  • 11
  • 34
0
votes
3 answers

Drupal + .htpasswd: How to lock down a dev site but allow access to single path

So I have a development site setup running Drupal. I've locked the site down with basic HTTPAuth + htpasswd to keep out baddies. The problem is that a single node, a webform, needs to be accessible on this dev site from the live site. My question…
imgrgry
  • 628
  • 1
  • 5
  • 11
0
votes
0 answers

Adding htpasswd to a certain URL (not the whole website)

I am trying to place a password on www.example.com/need-password/ url only. ie: www.example.com should just work as normal without needing a password. I am also looking to do this ONLY using Apache 2.4 (not Apache2.2)
John Crawford
  • 9,656
  • 9
  • 31
  • 42
0
votes
0 answers

Error with the htaccess and htpasswd files in codeigniter

I should protect only one Controller file with htaccess and htpasswd. I entered these instructions in the htaccess file, but I get an 'Internal Server Error' error. The .htaccess file and the .htpasswd file are located outside the application…
the_martux
  • 885
  • 2
  • 7
  • 18
0
votes
1 answer

Restrict access to root folder htpasswd except api url

I know that the question has been asked here : htaccess exclude multiple url from Basic Auth but in the answer I didn't find the solution my problem so I reask here. I want to block access to the root of a project in with htpasswd except for api url…
injetkilo
  • 300
  • 2
  • 10
0
votes
1 answer

Cracking/changing htpasswd

I have an old website that I created a folder that's protected with htpasswd. However, it's over a decade old, and I have since forgotten the password. I wish to access the contents of the folder. I'm able to view the directory contents via the…
user1118764
  • 9,255
  • 18
  • 61
  • 113
0
votes
0 answers

500 Internal Server Error after adding .htpasswd on EC2 with ELB

I have an instance running on EC2 that I want to password protect. my .htaccess file; RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} ^http$ RewriteCond %{REQUEST_URI} !^/healthcheck\.html$ RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}…
John107
  • 2,157
  • 3
  • 20
  • 36
0
votes
1 answer

.htaccess if statements for different .htpasswd files

I'm not entirely sure this is possible, but I have an application that is hosted on a few different URLs and a few different subdomains. Each of these has a basic protected section (using htpasswd). I'd love to be able to have ONE htaccess file,…
Richard
  • 1,148
  • 3
  • 18
  • 33
0
votes
0 answers

Auth protect a Wordpress site except one page

I protected an entire Wordpress site with an .htaccess in the /var/www/html direction containing the following regular authentication: AuthName "Restricted Admin-Area" AuthType Basic AuthUserFile /var/www/html/.htpasswd Require valid-user However,…
Bibelo
  • 221
  • 2
  • 8
0
votes
1 answer

Protect only a directory with htpasswd

I would like to protect the protect-me-dir directory with http password. I tried this code: AuthType Basic AuthName "restricted area" AuthUserFile /home/iterator/public_html/protect-me-dir/.htpasswd require valid-user It works, but unfortunately it…
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
0
votes
1 answer

Protect a given Laravel route with htaccess password

Is it possible to protect one!! laravel route with htaccess password? I have a migrator route and that one should be accessed with a htaccess password
fefe
  • 8,755
  • 27
  • 104
  • 180
0
votes
0 answers

htaccess Deny folder and subfolder and subfiles

i have a folder and i try to protect it and ALL his content with a password by using a .htaccess file i know how to protect a file AuthName "Message" AuthUserFile \www\.htpasswd AuthType Basic require valid-user it…
Aominé
  • 472
  • 3
  • 11
0
votes
1 answer

trouble with .htaccess authorizations

I have a Raspbian LAMP web server just for experimentation and I wanted to lock the main page with .htaccess. It does not work as it should. It will read the first line "AuthTyper Basic" and lock the page but nothing more after that. The "AuthName"…
0
votes
1 answer

.htpasswd not working - maybe because of reference

I have a server which i'm trying to setup a password on via .htaccess and .htpasswd. Here is my server document structure: The only path it shows higher than var is "/" which i'm assuming means root. Both my .htaccess and .htpasswd live in the…
red house 87
  • 1,837
  • 9
  • 50
  • 99