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

Remove .htpasswd protection from a subfolder

I have protected my root folder using .htpasswd AuthType Basic AuthName "Restricted Access" AuthUserFile /home/a1199104/public_html/.htpasswd Require user lamak The above code deny access to my whole site/folder/subfolder, I have a subfolder public…
user4795555
  • 13
  • 1
  • 3
0
votes
1 answer

Creating .htpasswd file outside webpage files

I'm working with a webpage that uses a content management system. The webpage belongs my university. We want create a private file with .htaccess and htpasswd. The problem is I can't figure out how to place the htpasswd file outside the webpage…
user1868607
  • 2,558
  • 1
  • 17
  • 38
0
votes
1 answer

Setup mercurial to only work with users already authenticated with my server?

I have a Mercurial server setup and would like to use it for source control over Apache. The setup i followed, however, requires that I have a .htpasswd which it uses to authenticate Mercurial users. Is it possible to have this authenticated list…
chustar
  • 12,225
  • 24
  • 81
  • 119
0
votes
1 answer

Nginx auth 403 error

Hi I'm trying to set up nginx to reduce the amount of ports I have open I'm trying to add a password and I've looked all over the web and can't seem to get the auth part to work correctly I created a .htpasswd file and placed it in the nginx conf…
Phairplay
  • 273
  • 2
  • 4
  • 16
0
votes
1 answer

Removing an unknown part of a string PHP

I'm writing a PHP script that updates a .htpasswd file (yes, I know it's not very secure, but I have several protections to prevent people from accessing the script). Right now, I'm just appending the current file, like that: $user = ''; // (Not…
R__
  • 183
  • 2
  • 11
0
votes
2 answers

How to protect all pages in wordpress blog with .htpasswd

I have been trying to add htpasswd authentication to my wordpress blog for all pages. So that when a person tries to view a page he has to be a valid-user. I tried adding the following snippet to my .htaccess file but it does nothing.
maths
  • 1,399
  • 5
  • 23
  • 38
0
votes
1 answer

Htaccess authentication

I have a hosting, where I got specified admin panel. On this panel I can set passwords and usernames, and the passwords get encrypted. So my question is: Is there any way for that to design the authentication? I mean, when it requires login and…
0
votes
3 answers

Password protect wordpress on Bitnami

I'm new to Bitnami and currently using a Google Cloud Platform for my VMs. I'm trying to password protect a wordpress installation for 1 of my VMs. It's a dev site so only going to be using the IP address to access the site. However following the…
0
votes
1 answer

fullpath php not displaying path on website

I'm trying to set up .htaccess on my website (hosted by GitHub, and on a custom domain), and I can't seem to find the full path to my .htpasswd file, therefore the files aren't working. I've followed this tutorial on how to find the full path, but…
bmarkley
  • 35
  • 7
0
votes
1 answer

How to use htpasswd For CKAN Instance

I have included Location header in My Virtual Host file. AuthType Basic AuthName "Restricted" AuthUserFile /etc/httpd/.htpasswd require valid-user Also created user to access the domain. but the user i have created using htpasswd is not allow…
Manish J
  • 686
  • 1
  • 8
  • 24
0
votes
1 answer

Restricted phpinfo.php file downloading rather than displaying in browser

I'm trying to set up my NGINX configuration file so that only users who have the htpsasswd can view our-site.com/phpinfo.php in their browser. Within my server block, I defined a location block for this in my /etc/nginx/sites-available/…
Holly
  • 7,462
  • 23
  • 86
  • 140
0
votes
1 answer

htaccess: Combine IP-Whitelist with htpasswd

my .htaccess looks like this: SetEnvIF X-FORWARDED-FOR "123.456.12.34" AllowIP Order deny,allow Deny from all Allow from env=AllowIP I want to combine this "whitelist" with a htpasswd: If a whitelisted IP accesses the server, a password request…
varlog
  • 61
  • 1
  • 3
0
votes
1 answer

How do we make .htpasswd to prompt on each visit?

AuthType Basic AuthName "Password Protected Area" AuthUserFile mywebsite/accounts/.htpasswd Require valid-user This is the current .htaccess file and have a .htpasswd file where we have user and password. We would like to prompt htpasswd on each…
Mahesh Babu
  • 145
  • 13
0
votes
1 answer

HTTP Basic Auth with Nginx on a url that doesn't exist as a directory

Trying to use Nginx to password protect mysite.com/admin the thing is here that I'm using a web framework, and /admin is just another configured route in the system NOT a real directory when I configured the site with: location /admin { …
RedactedProfile
  • 2,748
  • 6
  • 32
  • 51
0
votes
0 answers

Password Protected post and Password Protected admin exist together - suggestion

I have password protected some post on a site and in order to customize the text of the password protected post I have added this codes in my theme's function file;
Dipak Saraf
  • 127
  • 1
  • 1
  • 8