Jump to content

.htpasswd cannot create file


Syscribe

Recommended Posts

Using Apache 2.2.3 under Windows XP Pro

 

I'm trying to use .htpasswd to create a password file, but whatever filename I try to use, I get an error message that .htpasswd cannot create the file.  If I manually create an empty file first and leave out the -c the error message changes to cannot modify the file.

 

I would prefer to use a filename which relates to the particular site I'm setting up rather than .htpasswd to avoid the overhead of using groups - ie each site will have its own dedicated password file.  From the online documentation, it looks like this should be possible but I'm beginning to doubt that I should take anything as read!

 

Hope someone can help please

 

 

Link to comment
Share on other sites

Go:

htpasswd -bn username pass

 

That will give you a string like:

username:KDE0RX5e08e/E

 

Just put that in a file called any name you like. Typically .htpasswd is used as apache will not allow direct access to these files. (so someone cant browse and read your password).

 

-steve

Link to comment
Share on other sites

Thanks for the advice stevie.

 

In fact I've already bypassed the problem by downloading and using htpasswd Generator (www.htpasswdgenerator.com) which doesn't seem to have a problem creating the file and allows simultaneous viewing and editing of .htpasswd, .htgroup and .htaccess to ensure they're in agreement with each other.

 

However, I'm still intrigued as to why the command line .htpasswd can't create the file.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.