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

Setting up gitlab basic auth htpasswd

I am trying to have nginx authentication to a gitlab server. I have made the changes outlined here. But I am not sure where to actually generate the htpasswd at. I've tried these locations; /nginx/.htpasswd /var/log/gitlab/nginx/.htpasswd Where do…
0
votes
1 answer

Directory with .htpasswd is missing in directory listing

Having multiple directories in a parent directory, if I add .htaccess (see below) to a child directory, this directory is no longer listed in the parent directory listing. AuthType Basic AuthName "restricted area" AuthUserFile…
user2878850
  • 2,446
  • 1
  • 18
  • 22
0
votes
1 answer

Execute command with php

I want to know how can I execute a command which requires entering password after it, using php form. I am sending the username using a form on a website. This example is my php code for removing user from Redis and it is working. Rm_user is an…
Mirakurun
  • 4,859
  • 5
  • 16
  • 32
0
votes
1 answer

subdomain .htaccess & htpasswd files affecting root directory

I have built a site for a client using WordPress. The site was built on the subdomain http://staging.url.com. Using Plesk I restricted access to the 'staging site' using a password When site was completed I downloaded 'staging site', duplicated the…
Elliott James
  • 165
  • 14
0
votes
0 answers

Internal Server Error when trying to password protect my website

I am trying to password protect my whole website temporarily, using .htaccess and .htpasswd The .htaccess file reads: AuthUserFile .htpasswd AuthGroupFile /dev/null AuthName EnterPassword AuthType Basic require user xxxxxx When I try to access the…
MicroMachine
  • 179
  • 5
  • 16
0
votes
1 answer

Apache asks the password for each subdomain with htpasswd

Apache asks the password for each subdomain with htpasswd. I want that he would ask the password at the first input and remembered me for all subdomains I use the following code: AuthType Basic AuthName "Projects" AuthUserFile…
shurik2533
  • 1,770
  • 4
  • 22
  • 41
0
votes
0 answers

Internal Server Error when trying password auth and rewrite engine

we want to utilize Rewrite Engine utility and password protection in the same directory, we created .htaccess file for it, but unfortunatly it is not working and giving Internal Server Error what might the cause of it, or what we are doing wrong…
runningmark
  • 738
  • 4
  • 13
  • 32
0
votes
1 answer

How to put htpasswd in magento admin panel?

I have tried to add .htpasswd in magento admin panel. I have uploaded both file in the magento root directory. But my password prompt box coming also frontend. Please check and help me how to implement .htpasswd only for the magento admin not…
Chinmay235
  • 3,236
  • 8
  • 62
  • 93
0
votes
2 answers

How to config htpasswd with htaccess

i want to make some pages password protected using .htpasswd How can i do it ?? # Do the regex check against the URI here, if match, set the "require_auth" var SetEnvIf Request_URI ^/product-category/ require_auth=true # Auth stuff AuthUserFile…
0
votes
1 answer

Password protect specific pretty URLs in .htaccess

I need to password protect many pretty URLs in .htaccess via .htpasswd. But I want different user/login for each of the many protected pretty URLs (and a general login for pages not specifically protected). So, for example, I'd like to protect:…
steps
  • 774
  • 2
  • 16
  • 38
0
votes
2 answers

WP Admin trying to load asyncronously scripts in a htpasswd protected envirnoment

In my dev environment, for security reasons, my wp-admin folder is protected by basic authentication with htpasswd. When i'm logged in the admin area (after passing Basic Authentication and Wordpress Login), wordpress tries to load several scripts…
Stefano Ortisi
  • 5,288
  • 3
  • 33
  • 41
0
votes
0 answers

.htaccess/.htpasswd Protection for file doesn't work

I have a problem for which I have not yet found any solution. I want to make a file a accessible via .htaccess/.htpasswd. So I created this file and put it into a subfolder at my we bapplication: AuthType Basic AuthName "Username" AuthUserFile…
Silvio
  • 1
0
votes
1 answer

Error 404 not found with .htaccess in folder on XAMPP/Apache

I have a test server with XAMPP (Apache/PHP/MySQL) running on Windows Server 2003. I always used without problems .htaccess and .htpasswd files. On the site I'm working on I get ERROR 404 (yes! not 403) when trying to open any file inside the…
Perocat
  • 1,481
  • 7
  • 25
  • 48
0
votes
1 answer

Restricting access to node.js by userid

I find myself in a bit of a dilemma. I am preparing to push code out to a test server (out in the wilds of the Internet) which handles user registration and authentication (using Express + Passport) for acceptance testing. However, I would like to…
Not a machine
  • 508
  • 1
  • 5
  • 21
0
votes
1 answer

Symfony 2: Protect route with htpasswd

I'm on Symfony 2.3 and need to protect different routes with different htpasswd restrictions. There is one on the main route / and one on another route, like for example /restricted/user. Since http basic auth is broken in security.yml (in…
Johannes Klauß
  • 10,676
  • 16
  • 68
  • 122