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

After .htaccess login but does not direct properly

I have a .htaccess to protect the conf directory. The .htaccess code was generated by the 000webhost at the cPanel. # DO NOT REMOVE THIS LINE AND THE LINES BELOW PWPROTECTID:****** AuthType Basic AuthName "Restricted Access" AuthUserFile…
Chin
  • 593
  • 4
  • 15
  • 36
0
votes
1 answer

htaccess different user permissions for different users

I can't seem to find the proper way to write my .htaccess file. I initially had the file set up to allow access to a directory of files and that worked fine: AuthUserFile /var/www/html/technical/mep/.htpasswd AuthGroupFile /dev/null AuthName…
thecommonthread
  • 395
  • 4
  • 14
0
votes
1 answer

Don't Allow File Download Without htpasswd nginx

I've successfully set up auth_basic on Nginx using an .htpasswd file. However, if someone guesses the file name, they can still download files with wget or simply using a browser by providing the URL, even though they haven't successfully logged…
0
votes
1 answer

Using htaccess to force https not working for full urls with htpasswd

I am currently using htaccess to force all http requests on my apache2 server go to https. https is setup and working properly. The htaccess rewrite is working if i use just the base domain name (ex: http://mydomain.com ), however if i do something…
MirtheN
  • 13
  • 4
0
votes
1 answer

is it possible to change URL of webpage using .htaccess and also want to protect folders using .htaccess?

I want to change Webpage URL http://www.xyz.com/in/index.php?mpid=page1 to http://www.xyz.com/in/page1 using .htaccess. And also want to protect my folders with username and password.
0
votes
2 answers

Apache User change/create password on first login

I have an index.php page for which i need to add user authentication I have about 80 users that will need access to this page. I want the users to change the password when they first connect to my page or a way for them to create their own password…
user2280769
  • 210
  • 4
  • 13
0
votes
0 answers

Allow access to 'subdirectory' created by URL router with Apache

I have a development server for a website I am re-developing with an API backbone. I want the domain to be protected from outside access, so I require a valid htpasswd user on all domains hosted on the dev server. This causes problems though because…
Sam
  • 20,096
  • 2
  • 45
  • 71
0
votes
0 answers

facing issue with htpasswd in wordpress site

I am trying to develop http authentication in one of my wordpress site. I have done below code for this. in my .htaccess file at root folder. # BEGIN WordPress RewriteEngine On RewriteBase /htpass_wordpress/ …
Rukmi Patel
  • 2,619
  • 9
  • 29
  • 41
0
votes
1 answer

php or other script to close browser session after html form submission

I recently implemented a .htpasswd based login page and am trying to figure out a certain way I have in mind to close the browser window (because that is how I can reset the authentication so the user cannot log in again). My idea is that once the…
mateikav
  • 93
  • 3
  • 9
0
votes
1 answer

Htaccess and htpasswd authentication fail

I have the following code to protect my application: .htaccess: AuthType Basic AuthName "My Protected Area" AuthUserFile .htpasswd Require valid-user .htpasswd: username:$apr1$Am/5PMEt$JofEYwKBM8rhEnsoLndir/ The .htpasswd file is in the same…
Dennis Hackethal
  • 13,662
  • 12
  • 66
  • 115
0
votes
1 answer

Create .htpasswd files within C#

For a small tool to automate website deployment I'd like to generate .htaccess and .htpasswd files. How do I create the hashes for the passwords in my code?
ldrdl
  • 446
  • 1
  • 3
  • 16
0
votes
1 answer

Externally managed htaccess-protected members area in WordPress with url rewriting?

I am considering converting a client project from a large number of hand-built web pages to a WordPress install. However, this client has a free area (site.com/) and a members area (site.com/members/). The members area is standard Apache .htaccess /…
Edward Barnard
  • 346
  • 3
  • 17
0
votes
0 answers

htaccess file protecting but no pass prompt

Hi I have the following in a .htaccess file: AuthType Basic AuthName "restricted area" AuthUserFile /web/clients/.htpasswd require valid-user this works in making the directory private, however I get a 403 error and no password/user pop up appears…
0
votes
1 answer

Htaccess to use the hosting for live testing

I would use the hosting for live testing, but I want to protect access and prevent search engine indexing. For example (server directory structure) within public_html: _private _bin _cnf _log _ ... (more default directories…
ephramd
  • 561
  • 2
  • 15
  • 41
0
votes
1 answer

htpasswd on port number

Is it possible to use htpasswd, or some kind of htaccess rule to secure a specific port number. For example I have database profiler running on port 5533, and would like to stop the public accessing it. Thanks
outrunthewolf
  • 125
  • 2
  • 12