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

htaccess vs password protected directories

I have to add a password protected zone to a site I am working on (using the .htpasswd file). The thing is the whole directory structure it's being pointed at doesn't exist and is created through mod_rewrite. Will it still work, or does the…
Meep3D
  • 3,803
  • 4
  • 36
  • 55
1
vote
1 answer

Password protecting a single page using .htaccess and .htpasswd

Ok so I want to protect a single webpage using .htaccess and .htpasswd I have successfully implemented this to work on my index.php page but if I go any deeper it doesn't work. I'm using codeigniter and here is the code from my .htaccess file #…
RyanUK
  • 67
  • 2
  • 12
1
vote
4 answers

Easiest way to password protect my Laravel app online for development purposes

I am wanting to password protect my laravel application, ideally just on the deployment server (I'm using Fortrabbit), however, I don't mind logging in to my local development server. I initially thought a route filter would suffice, but this…
user860511
1
vote
1 answer

Apache: .htaccess htpasswd still shows website on Android using satisfy any

I have this in my .htaccess to require a password but allow certain whitelisted IP addresses without authentication. Order deny,allow Deny from all AuthType basic AuthName "Admins Only" AuthUserFile /etc/apache/.htpasswd Require valid-user #replace…
DWils
  • 390
  • 1
  • 4
  • 16
1
vote
1 answer

Elastic Beanstalk - set .htpasswd on specific environment

I have a PHP website configured within Elastic Beanstalk on two environments, a production environment and a stage environment. Within each environment I have an APPLICATION_ENV environment variable set which identifies to the code which environment…
1
vote
1 answer

htaaccess password protection

i have a development version of a site and so am using password protection. The problem is i am using cloud for managing static contents like images. css, js etc Ste URL : http://www.example.com Static url: http://cdn.example.org Where cd, is a "A"…
Prajila V P
  • 5,027
  • 2
  • 23
  • 36
1
vote
0 answers

.htaccess password protection not working with encrypted password

I want to make my admin folder protected with htaccess file.Here is my htaccess file AuthType Basic AuthName "Title for Protected Site" AuthUserFile C:/WAMP/www/mysite/admin/.htpasswd Require valid-user I made htpasswd file and had password…
user3173457
  • 47
  • 2
  • 9
1
vote
2 answers

Add multiple users in Subversion

I am following the method described in http://www.maketecheasier.com/setting-up-subversion-version-control-in-ubuntu for creating a subversion repo.It works fine. But when I try to create a second user using sudo htpasswd -cm…
user7282
  • 5,106
  • 9
  • 41
  • 72
1
vote
0 answers

htaccess login form IE issues

I've been using info from here on Stacked and have now got an HTML form for use with htaccess, the login info get sent via login.php
1
vote
1 answer

HTTP Basic Auth Upon Image View (.htaccess)

I saw this and I'd love to know how to recreate it. Unfortunately, I don't know .htaccess. Upon viewing an image, there was an HTTP Basic Auth style dialog that asked to enter some sort of authentication (albeit nothing actually submitted…
Goodies
  • 4,439
  • 3
  • 31
  • 57
1
vote
1 answer

How to authenticate a request with htpasswd in Node.js

I am trying to fetch a rss feed from our staging site and at present it has htpasswd security on it. I have tied using the format: http://username:password@url.com This works on the browser but when I try to do this with nodejs it fails. Could you…
whizcreed
  • 2,700
  • 3
  • 22
  • 35
1
vote
1 answer

set HTPasswd for specific GET request in a url

I have a website build in cs cart. The url of administrator panel is like this https://mysite.com/vendorsds.php. I want to set a HTPasswd for user whenever he/she visit this link https://mysite.com/vendorsds.php?dispatch=companies.update. I have…
Mithun Sen
  • 523
  • 5
  • 19
1
vote
1 answer

nginx htpasswd protect works fine for the whole site, but not a subdirectory with rewrite

I have ecountered a strange problem, here is my NGINX conf file # For whole site location / { auth_basic "Restricted"; auth_basic_user_file /home/john/.htpasswd; } # Forum rewrite location /forum/ { try_files $uri $uri/…
user702300
  • 1,211
  • 5
  • 22
  • 32
1
vote
2 answers

htpasswd escaping "$" in perl variable

So we have a script that connects to a database and pulls down a list of usernames passwords. Then we have a subroutine that hits the login and password with /usr/local/apache2/bin/htpasswd -bc then dumps them in to a /tmp/file. Some users were…
capser
  • 2,442
  • 5
  • 42
  • 74
1
vote
1 answer

mod_rewrite and htaccess password protection together

I am currently trying to combine the two - htaccess password protection and mod_rewrite. My problem is, that the code below is resulting an error: "No input file specified." Options +FollowSymLinks -MultiViews …
denlau
  • 916
  • 2
  • 9
  • 21