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

Manually Password Protect Files/Folders (Linux)

I want to make file/folders password protected in Linux(Centos) using htpasswd. I have done following:- root@ cd /mnt/Recordings/CONF (I have Changed the directory) CONF@ htpasswd -c .htpasswd xxxxx CONF@ pwd /mnt/Recordings/CONF CONF@ vim…
user2932003
  • 171
  • 2
  • 4
  • 14
0
votes
1 answer

Password Protected on .htaccess

I am wondering about a password that I have config on a file .htpasswd to protect some of my web site folders. The main problem is when I have input a valid user name and an invalid password, it can also let me in. However, the invalid password I…
0
votes
1 answer

IdeaWebServer .htacces and .htpasswd

I have IdeaWebServer and I try to secure files by the .htpasswd. When I try to acces my page the login window doesn't show up. Here is my .htacces code AuthType basic AuthName "Login" :Location /users/www/domain.com/wp-login.php AuthUserFile…
0
votes
0 answers

PHP | .htpasswd | Can not login custom admin page with same username and password

I use a free shared php web server for my site. my site's url end was p.ht and for some issues it changed to w.pw In order to make my site working properly again, by using Notepad++ I used "Find in Files" subwindow which is in ctrl+F popup window. I…
Andre Chenier
  • 1,166
  • 2
  • 18
  • 37
0
votes
2 answers

htpasswd password protect site

I have member area and im try protect access to this url http://site.com/wp/ with htaccess, all this working fine , here is code from my htaccess.. AuthName "My Site" AuthType Basic AuthUserFile /home/site/.htpasswd AuthGroupFile /dev/null require…
Milan Milosevic
  • 413
  • 2
  • 8
  • 19
0
votes
1 answer

Wordpress Htaccess and htpasswd Encrypted passwords of imported users

I have the following problem, I have users in my database with wordpress encrypted passwords. There are pdf files I do not want all of them to access so I am going to use htaccess and htpasswd files. The problem is when I copy their passwords to the…
daw dasf
  • 35
  • 6
0
votes
0 answers

How to get the same result with htpasswd using PHP?

I'm using a Debian 7.0 with PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli). I need to build an htpasswd files from a form (data stored with MySQL). I tried that but didn't work: $hash = crypt($_POST['password'], base64_encode($_POST['password']));…
Hihui
  • 1
  • 2
0
votes
0 answers

Http Authentication: Global user login

I have several subdomains, some of them protected by HTTP authentication (htpasswd). Is there a way to login to all subdomains once the user login to one of them?
Vojtěch
  • 11,312
  • 31
  • 103
  • 173
0
votes
2 answers

I want to htpasswd protect a single file not files in subdirectories

I have a .htpasswd file in the root of my domain and a .htaccess file which should protect a single index.php file. Unfortunately it appears asif index.php files in subdirectories are also protected. Is it possible to make this work on a single file…
joren
  • 89
  • 1
  • 9
0
votes
1 answer

htpasswd only for POST-requests

I'm creating a simple little (rest)API and now I would like to secure a part of this API with htpasswd (using the oauth library is too much hassle for the simple thing I'm trying to make). Is it possible to only use the .htpasswd file for incoming…
Terrabythia
  • 2,031
  • 3
  • 19
  • 29
0
votes
1 answer

apache authentication with .htpasswd password using salt

I am wondering how the Apache server authenticates me with .htpasswd I have a .htpasswd file inside a folder. The .htpasswd content is generated with php and the password is encrypted with the crypt() function like…
0
votes
1 answer

how to make a download directory for valid users without being logged in, just by browser authentication?

Hi and best greetings to everybody! as the subject shows i am trying to make a directory in my server which only valid users are allowed to download from. of course i don't want my users to be logged in to my site but only got authenticated by…
N.O.Y B
  • 33
  • 6
0
votes
2 answers

HTTP authentication using htaccess/htpasswd ...dialogue box comes up twice

I have a site that has the main path under password protection. I also have a subfolder that have a separate (htaccess/htpasswd) password protection. For some reason, when I access the subfolder, I'm asked to put in my id/password twice. All of…
milesmeow
  • 3,688
  • 5
  • 35
  • 58
0
votes
2 answers

.htaccess not working at all

I've got a file accessible through my web website by typing http://www.mywebsite.com/myfile and the server run on debian. I'd like to put an authentication with a .htaccess and .htpasswd when trying to access to previous url. I'm quite new to…
bash_profile blank
  • 311
  • 1
  • 4
  • 13
0
votes
1 answer

different htpasswd files per domain

I've 2 domains e.g. foo.com and bar.com which share the same document root. The sites are protected by a .htaccess file AuthUserFile ../.htpasswd AuthName "No Access" AuthType Basic require valid-user how can I set…