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
2 answers

Redirecting with .htaccess and its password protected

Please could anyone help me in my hour of need? :) I have been working on a landing page that's been set up for corporations and their employees. Anyway the gist is, the page is only available via login which is provided via promotional…
debonator
  • 85
  • 2
  • 13
0
votes
1 answer

.htacces path to .htpasswd causing internal server error

So i've tried pretty much every path possible but every time i'm getting an internal server error, maybe i'm overlooking something anyone has an idea? path to .htacces: /domains/domain.com/public_html/route/portfolio/inc path to .htpasswd …
LvdM
  • 15
  • 4
0
votes
1 answer

Can't login to .htpasswd protected directory created with ansible

I am trying to use ansible to create .haccess and .htpasswd files htpasswd: path=/mypath/.htpasswd name=test password=test owner=root group=root mode=0640 But I can't login with the test:test credentials The value inside the file does seem valid…
Jon M
  • 454
  • 1
  • 7
  • 20
0
votes
0 answers

How do you exclude a directory from .htpasswd?

Our DEV server uses apache's .htpasswd to protect each site but our CMS requires the file directory to be excluded or multiple file uploads won't work. After searching, we're trying the following in the virtual host file but it doesn't seem to…
CMSCSS
  • 2,076
  • 9
  • 28
  • 49
0
votes
1 answer

Password protected folder protects the folder but not the files (.htaccess)

I have set up a password protected folder on my Apache server. I have a .htaccess file in the folder I want to protect, and a .htpassw in the Private folder. The problem is when I enter the URL to the folder, the authorization challenge dialog…
TripleAntigen
  • 2,221
  • 1
  • 31
  • 44
0
votes
2 answers

htaccess and htpasswd issue

i'm having an issue with setting up htaccess and htpasswd for a specific folder on my web server. I have exhausted all material and answers that currently exist on stackoverflow and have got no where. This is the best guide I have found…
JohnB
  • 601
  • 2
  • 10
  • 19
0
votes
1 answer

Allow access to only one or few multiple IP addresses and for a specific URL

I need to deny all access to a certain page/URL on a website and only allow access to that page/URL if they are on the companies IP address or address/range. This is what I currently have. RewriteEngine On RewriteCond %{REMOTE_ADDR}…
0
votes
0 answers

Variable in Path to .htpasswd file in .htaccess

Would it be possible to have the {HTTP_HOST} variable in this path? Because my htaccess is used for multiple domains and I want to use different passwords for each domain! AuthUserFile /usr/test/{HTTP_HOST}/.htpasswd AuthType Basic AuthName "My…
Tom Senner
  • 111
  • 9
0
votes
1 answer

Apache limit active sessions per user [.htaccess]

I've searched all of google and stackoverflow for this, but with no success. I'm starting to feel the simple answer to this question is "no", but I haven't been able to confirm this either. Is there a way to limit apache to 1 session per…
0
votes
1 answer

How get know if file_exist in .htacces protected folder

how can I find out, if file exist in folder, which is password protected via .htaccess (I know password) This not working: $filename = "http://username:password@website.com/pictures/12.jpg"; // folder have password if (file_exist($filename))…
0
votes
1 answer

Simple .htaccess doesn't work

I tried to create the .htaccess and the .htpasswd whith sulbime text 2, then notepad++, notepad with different encoding and rename my file in filezilla but I still get an Internal server error. I get my path with the line Here my .htaccess AuthName…
0
votes
1 answer

Error with subdomain basic authentication via htpasswd

Issue: I have Laravel running on Apache 2.4.9 and my domains are organized as follows: beta.domain.com => /var/www/beta www.domain.com => /var/www/live The beta subdomain has basic authentication. Everything is working as expected except…
mistermat
  • 327
  • 4
  • 14
0
votes
1 answer

.htaccess and .htpasswd not working when protecting my site

I have a need to password protect an entire website. I am developing on a live URL (don't ask me why -_- clients...) and I want to be able to develop the site but access it using a username and password so the general public won't be able to see the…
phynam
  • 467
  • 2
  • 12
0
votes
1 answer

Should I use the same folder for .htaccess and .htpasswd?

When I choose the same directory for .htaccess and .htpasswd, everything working fine. But the situation below makes me sad. I have one .htacces file in the root folder (johan) containing the code below. AuthName "johan User" AuthType…
Dinoop
  • 479
  • 4
  • 10
0
votes
1 answer

NGINX : Allow users to password protect directories themselves?

To my knowledge Nginx can only password protect directories from within the configuration file(s). That works nicely, but is not a real option for end-users who A) can not edit the configs and B) would break the configs if they could Right now I am…
MattW
  • 538
  • 1
  • 4
  • 12