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

Android App Development, Web Server, and htpasswd

I am developing an Android app that ties into a web app thats also being built in parallel the problem is, the services web side are being built behind htpasswd auth. Which I believe is going to hinder my ability to make an android app that will…
chris
  • 36,115
  • 52
  • 143
  • 252
0
votes
2 answers

Allow PHP file access to protected folder?

I have a site www.abc.domain.com protected with .htaccess & .htpasswd. I have file a callback.php file that need to access www.abc.domain.com and check for data. This file is in other server, other domain. I use curl to request. I see…
Kien Pham
  • 35
  • 1
  • 9
0
votes
2 answers

allow php file access protected folder by .htpasswd?

I have a site www.abc.domain.com, I protected it with .htpasswd. Now I have other www.domainname.com that contains a file callback.php, it requests to www.abc.domain.com. How do I write .htaccess file for both protecting www.abc.domain.com & allow…
Kien Pham
  • 35
  • 1
  • 9
0
votes
1 answer

Password protect a directory inside CakePHP webroot dir

For all kinds of reasons, I have a dir inside app/webroot/ that needs protection (/files). I'm not familiar with the inner workings of CakePHP, because I hired someone for this project. This person, however, can not supply an answer. It's also not…
Derk Arts
  • 3,432
  • 2
  • 18
  • 36
0
votes
3 answers

How to protect subfolder which contain php page

I have made a subdomain for my web-site which I will use to store all the important scripts, both php and javascript. I want to protect evertyhing there so that it cannot be accessed from a web-browse. I have tried .htpasswd. But when the page be…
Alex
  • 35
  • 6
0
votes
1 answer

Apache .htaccess - Can't access a file while trying to protect?

I am attempting to lock a file out for me only (it's a log, and I don't want users to see it). This is my .htpasswd: foo:bar And this is my .htaccess: AuthUserFile /home/kapip/public_html/.htpasswd AuthType Basic AuthName "This is allowed for admin…
user569322
0
votes
2 answers

how to Folter password protection using .htaccess and .htpasswd?

This my path: http://172.21.4.100/bluescope_app/index.php?page=creer_contact_client I have two files: 1st: .htpasswd holds only: dave:***password*** 2nd: .htaccess holds: AuthType Basic AuthUserFile /172.21.4.100/bluescope_app/dave/.htpasswd …
k6t back
  • 87
  • 1
  • 8
0
votes
0 answers

mod_rewrite, reverseProxy and .Htpasswd

So... i've been really struggling with this one, because it absolutely doesn't make any sense to me, but without further delays... I'm running two servers, one on IIS, the other is Linux: Server1 = IIS Server2 = Linux (centos) I've created a rewrite…
Hanan
  • 11
  • 2
0
votes
0 answers

Protecting files using htpasswd but every time it's not accepting the password

I am using hostinger hosting, I have my root folder /public_html and I have added the .htpasswd file in this folder. I have another folder called /publish_html/demo and I have to protect this folder so I have added the .htaccess file to this…
Naren Verma
  • 2,205
  • 5
  • 38
  • 95
0
votes
1 answer

Configuring Apache to look for configuration files (.htpasswd) in DocumentRoot not in ServerRoot

I'm looking for a way to force Apache to look for files relatively to DocumentRoot not to ServerRoot. Now if I create .htaccess as follows: #Protect Directory AuthName "Please provide valid username and password" AuthType Basic AuthUserFile…
Marcin Bobowski
  • 1,745
  • 2
  • 19
  • 35
0
votes
0 answers

File Protection using .htpasswd

I'm running a small private wordpress blog and would like to protect the wp-login.php using .htaccess and .htpasswd. I'd like to be promoted by a additional password prompt when trying to access the wp-login.php file. Using this in my .htaccess…
Newbie
  • 1
  • 1
0
votes
1 answer

chpasswd.cgi - change password on web won't work with more than 8 chars

Good night! I'm using a chpasswd.cgi to change password via web, the problem is that when I change the password to 123456789 it won't work. I'm migrating a proxy server to a new one, and I have more than 2k of password. I noticed that the crypt()…
Renobr
  • 3
  • 2
0
votes
1 answer

Exclude subdirectories in htaccess / Ask for different credentials in subdirectories / Stop infinite loop of authentication

I want to have htaccess ask for password on my entire site. However one subdirectory (folder1, which has WordPresss installed) should ask for a different login information (userY). When I remove the auth thing from htaccess in the main folder…
0
votes
1 answer

How can I use .htpasswd across my entire site?

How can I use my .htpasswd login "session" all across my site? I want to be able to login to via /admin.php using my .htpasswd account, then display certain admin features on other pages, ex. /browse.php, if the admin is logged in. Here's what I…
Aaron
  • 1,956
  • 5
  • 34
  • 56
0
votes
0 answers

Openlitespeed password protected realm and rewriting rules

I am working with openlitespeed and have for my php application a virtual location "/backend/" which I like to have password protected. I also using "rewrite" rules at the root context so the requests get routed to my "/index.php". I noticed when I…
megloff
  • 1,400
  • 4
  • 27
  • 44