简体   繁体   English

如何在.htpasswd文件中补充密码

[英]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.. 我在同一目录中创建了.htaccess文件。

 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 和我的.htpasswd文件在同一目录中

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 所以我的问题是如何在上面的字段'encryptedpassord'设置我自己的自定义密码,因为我读到我们不能仅仅组成密码,在Unix / Linux服务器上它们必须由服务器加密,在Windows服务器上您只使用纯文本密码,因为Windows不提供任何加密方法

IS THERE ANY METHOD TO SET OWN CUSTOM PASSWORD? 有什么方法可以设置自己的自定义密码?

You can just use htpasswd command to create a new entry in that file. 您可以仅使用htpasswd命令在该文件中创建一个新条目。

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

will ask you for the password of john, then will create a user entry for it. 会要求您输入john的密码,然后为其创建一个用户条目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM