.htaccess
AuthName "Restricted Area"
AuthType Basic
AuthUserFile path/.htpasswd
require valid-user
.htpasswd
test:FUgb1Qdh6571o
#This tool is used to generate password file http://tools.dynamicdrive.com/password/
When Apache is running on Windows 10 and I’m trying to access folder authentication dialog appears, however it does not authenticate and does not allow to access restricted folder.
Apache error logs:
AH01617: user test: authentication failure for "/folder": Password Mismatch
Same setup works correctly when Apache is working on Ubuntu
What could be wrong? Different method of password storing?
2
Answers
I don’t know about online tool you used, but I recommend to use
htpasswd
tool generate passwords.Appear that
test:FUgb1Qdh6571o
is generated with algorithm that are not recommended. More info about htpassword could be found at htpasswd docsTo create a new
db
use:To update password use:
PS. I don’t recommend to use online passwords generator.
Could be harvested and later used against you.
PS.2 Probably
htpasswd
command is inapache installation directory
It could be fault of the line ending encoding, which is
LF
on Linux andCR LF
on Windows.In a hex editor
LF
would show up as0a
whereasCR LF
would be0d 0a
. On Ubuntu you can check withxxd .htpasswd
from the terminal and on Windows you can use Notepad++ to show special characters.