Anshuman Singh
Anshuman Singh

Reputation: 1152

How to makeup password in .htpasswd file

Here I want to protect a directory of a website which require a username and password to access..

I created .htaccess file in same directory..

 AuthName "Member's Area Name"
 AuthUserFile /path/to/password/file/.htpasswd
 AuthType Basic
 require valid-user

and here my .htpasswd file in the same directory

username:encryptedpassword
fred_smith:oCF9Pam/MXJg2

So my problem is how to setup my own custom password in the above field 'encryptedpassord' as I read we cannot just make up the password, on Unix/Linux servers they must be encrypted by the server, on Windows servers you do just use a plain text password as Windows does not offer any encryption methods

IS THERE ANY METHOD TO SET OWN CUSTOM PASSWORD?

Upvotes: 3

Views: 4058

Answers (1)

Özgür Eroğlu
Özgür Eroğlu

Reputation: 1270

You can just use htpasswd command to create a new entry in that file.

htpasswd /path/to/password/file/.htpasswd john

will ask you for the password of john, then will create a user entry for it.

Upvotes: 4

Related Questions