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

Lighttpd mod-auth Bcrypt hash

I am working on making a homemade NAS and was implementing a download share feature using Lighttpd. I know how to use Apache, but since I was hosting the webserver on a small Raspbery Pi, I felt Lighttpd would be just more "lighter". I have a…
D_Pain
  • 7,123
  • 1
  • 11
  • 12
0
votes
1 answer

Specify rewrite parameter in .htaccess

In my htaccess I think I must wrong path of RewriteBase. My server has this structure: /public_html/example and in this example there are all my site so to go on my site I do this url: http://home.com/example But I get 500 internal server because…
Poppy
  • 27
  • 7
0
votes
1 answer

I need to let access only user in .htaccess

I need to give only a user the permission to see the web site so this is my htaccess file: # BEGIN WordPress RewriteEngine On RewriteBase /party/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond…
Poppy
  • 27
  • 7
0
votes
0 answers

htaccess/htpasswd - pages with links to passworded directories are also password protected?

I have the two files, htaccess and htpasswd. Within my sub domain I have client directories which need to have a different password for each. This is fine and I have it working when you go to each directory manually or when linked from a different…
0
votes
1 answer

How to protect entire domain/directory with .htpasswd in Laravel's Forge

I'm having trouble protecting an entire domain with a password prompt. I need to do this with the server (like you can with .htaccess in Apache). My website is hosted on DigitalOcean servers with the server provisioned by Laravel's Forge. The…
Gavin Kemp
  • 461
  • 6
  • 11
0
votes
0 answers

Can a .file (.htpasswd) be accessed via browser?

I was reading this How secure is .htaccess password protection? and reviewing the fact that one of my sites has the .htpasswd file in a web facing directory. But, if the permissions on a .htpasswd file are correct (644), can it be accessed at all…
Steve
  • 1,371
  • 1
  • 16
  • 38
0
votes
0 answers

Hashing passwords - For directory access

So a little background of the situation first: I have a 3rd party application that has been written only to work within it's directory itself and also only with JSON files. Now the problem I have is that it is all pretty much written in js, jquery…
0
votes
2 answers

problem protecting a directory using .htaccess

I have created a .htaccess and .htpasswd files, and stored them in the folder I want to protect and when I navigated to that folder, I was asked for the username and passowrd (stored in the .htpasswd file) after entering the username and password, I…
sikas
  • 5,435
  • 28
  • 75
  • 120
0
votes
1 answer

Apache: require ldap group or htgroup membership

I'm working on transitioning our users from htpasswd/htgroup auth to ldap. While this in progress, I want to allow Apache to authorise users from both ldap and htpasswd. I have the following in my config... AuthBasicProvider ldap file AuthUserFile…
user1751825
  • 4,029
  • 1
  • 28
  • 58
0
votes
1 answer

opencart .htaccess force https and htpassword

Goal My goals is want to redirect all http traffic to https with www. prefix I want to add htpasswd in my admin directory.(https) Current problem When I access to https://www.myshop.com/my/admin it prompt for Basic Authenticate. When I input…
Shiro
  • 7,344
  • 8
  • 46
  • 80
0
votes
1 answer

Identical .htpasswd files, but only one works

I have a problem that's baffling me. I couldn't get my .htpasswd file to work: no matter what I'd do, my web server would refuse my credentials. In desperation, I finally made a second file called .xxx. This file is identical, as you can see in the…
Adam Smith
  • 449
  • 9
  • 23
0
votes
0 answers

Restrict Access to one of subdomains, excluding a directory with .htaccess & .htpasswd

I'm currently have several websites with different subdomains. They have a common .htaccess file. Example: sub1.domainname.com sub2.domainname.com sub3.domainname.com exclude.domainname.com sub4.domainname.com ... And I would like to restrict…
solosik
  • 11
  • 2
0
votes
1 answer

how to parameterize the path to the .htpasswd in the .htaccess file?

I have the following code in my .htaccess file AuthUserFile ./.htpasswd AuthGroupFile /dev/null AuthName "Dev Area One" AuthType Basic require valid-user This causes a 500 internal server error because Apache says it can't…
John
  • 32,403
  • 80
  • 251
  • 422
0
votes
1 answer

htaccess & htpasswd not hooking up correctly

Every time I try to go to Art School on Home Page and put it the correct username/password I get a server error. Yes this is homework, and yes it is my first time doing anything related to this type of setup so any help would be appreciated. All…
Bobby
  • 18,217
  • 15
  • 74
  • 89
0
votes
1 answer

Symfony2 simple .htaccess password protect for dev purpose

I would like to use a .htaccess file to protect my symfony2 website while developing it. I added the following line at the beginning of my .htaccess located in /web and a .htpasswd file just next with my password. AuthName "Développement" AuthType…
Gauthier
  • 1,116
  • 2
  • 16
  • 39