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

phpmyadmin .htpasswd file missing in ubuntu 14.04

I have installed mysql-server 5.5 and phpmyadmin. It was working before but currently I am having Internal Server error for phpmyadmin. In apache server error log following message is showing. [Wed Jan 21 02:38:26.501839 2015] [authn_file:error]…
1
vote
2 answers

Accessing special files in apache2

i want to know how to have access some files in special directory which is need to be authenticate with apache web server this is my config file Order deny,allow AuthType Basic AuthName …
H00man
  • 375
  • 1
  • 7
  • 21
1
vote
2 answers

Htaccess... first force www than ask for login

I have an .htaccess file that mainly does 2 things. Force www on the domain and ask for login credentials (with .htpasswd). If I now visit domain.com it will ask for a username and password. When I fill them in I get redirected to www.domain.com and…
FinalFrag
  • 136
  • 8
1
vote
0 answers

.htaccess 500 internal server error ubuntu 14.04

Hi trying to password protect my wordpress website by using .htaccess & .htpasswd, but i keep getting an error "500 Internal Server Error" I think its because of the AuthUserFile part of the .htaccess file. on my wordpress header i have entered the…
R4zerx420
  • 11
  • 4
1
vote
1 answer

Protecting folder using .htpasswd, but allowing php download while protecting password

I have password protected a folder using .htpasswd and .htaccess that contains digital assets that I want to control the downloading of using php. I was planning on offering a download link using the…
Amy Neville
  • 10,067
  • 13
  • 58
  • 94
1
vote
0 answers

how to make htpasswd authenticate once per session

how to make htpasswd authenticate once per session, as If I have a link to the same directory, it asks me to re authenticate. my directives are: AuthType Basic AuthName "installation Page" Require valid-user
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
1
vote
1 answer

Nginx - Unable to secure directory with htaccess nginx

I need to secure a particular folder in a Ubuntu Server 12.04 running Nginx. I followed this tutorial: http://nginxlibrary.com/password-protect-a-directory/ and many others like it. I created a file called .htpasswd using apache utils and put it in…
1
vote
1 answer

Reuse drupal password hashes in htpasswd

I have an existing Drupal 7 database with password hashes like this: U$S$92keK3LGE6O3i/yZoftycq9AXzAlwGPqn3nfn2gRO6z6U0Q.9IPM U$S$9SStyGBYv95n.yfhyZzNdHggooRGOxem6zgbDreZO34LgxLYQN5z ... I want to temporarily re-use these login accounts for a…
hoju
  • 28,392
  • 37
  • 134
  • 178
1
vote
2 answers

Protecting directory via .htaccess file without having root permissions

Currently I try to prevent access to a directory on my apache2 web-server via .htaccess and basic authentication: AuthType Basic AuthName "Private" AuthUserFile ?/.htpasswd require valid-user Lets say directory path is /foo/bar, so .htacccess as…
1
vote
1 answer

creating multiple .htaccess redirects

I currently have a website that is redirecting from - #-- Redirect http://www.mywebsite.com/en/index.php ---> http://www.mywebsite.com/ #Redirects RewriteEngine On RewriteCond %{REQUEST_URI} ^/en/index.php$ [NC] RewriteRule ^(.*)$…
Tim Valishin
  • 51
  • 1
  • 7
1
vote
2 answers

to makeup username:password pair in .htpasswd file

I have wamp server installed on windows OS my .htpasswd looks like username:encryptedpassword john:gugyjfy6786hgfhfh but the problem is to make-up encrypted password is never possible by hand so can i create it in text/plain format
user4046494
1
vote
2 answers

Do not override htpasswd in domain

I have a domain (also folder structure) *.dev.xxx. I need to make a htpasswd that will require credentials on every site on that domain. My .htaccess AuthType Basic AuthName "test" AuthUserFile /var/www/dev/.htpasswd Require valid-user But when the…
tttpapi
  • 887
  • 2
  • 9
  • 32
1
vote
1 answer

I have got problems with nginx http autorisation

I take project from job to home with all of their configuration and with htpasswd.pwd file. At job all works great, at home i see internal 500 error. In logs I have got this: 2014/08/03 21:06:53 [crit] 8543#0: *15 open() "/etc/nginx/htpasswd.pwd"…
1
vote
1 answer

.htaccess Condition only apply authentification to staging domain

I'm using the following code to block users on my staging subdomain. AuthName "PRIVAT" AuthType Basic AuthUserFile /var/www/mydomain.com/.htpasswd require valid-user Since I'd like to use the same .htaccess for staging and production I'd like to…
Manuel
  • 9,112
  • 13
  • 70
  • 110
1
vote
2 answers

how to makeup username:password pair in .htpasswd file on wamp server installed on windows OS

I am using Windows 8.1 OS and I installed Wamp server ...i google and found that " it should very rarely be edited by hand. There is a special program on a *nix machine that is designed to manipulate the .htpasswd file on your behalf. " so my…
Anshuman Singh
  • 1,134
  • 1
  • 13
  • 21