我在Windows操作系统上安装了wamp服务器 我的.htpasswd看起来像
username:encryptedpassword
john:gugyjfy6786hgfhfh
但问题是化妆加密密码永远不可能手工制作,所以我可以用text / plain格式创建它
答案 0 :(得分:0)
Apache为此提供了一个命令行工具。在htpasswd
目录中搜索bin
文件。传递--help
参数可以为您提供:
Usage: htpasswd [-cimBdpsDv] [-C cost] passwordfile username htpasswd -b[cmBdpsDv] [-C cost] passwordfile username password htpasswd -n[imBdps] [-C cost] username htpasswd -nb[mBdps] [-C cost] username password -c Create a new file. -n Don't update file; display results on stdout. -b Use the password from the command line rather than prompting for it. -i Read password from stdin without verification (for script usage). -m Force MD5 encryption of the password (default). -B Force bcrypt encryption of the password (very secure). -C Set the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 31). -d Force CRYPT encryption of the password (8 chars max, insecure). -s Force SHA encryption of the password (insecure). -p Do not encrypt the password (plaintext, insecure). -D Delete the specified user. -v Verify password for the specified user. On other systems than Windows and NetWare the '-p' flag will probably not work. The SHA algorithm does not use a salt and is less secure than the MD5 algorithm.
根据我的理解,您需要按如下方式执行命令:
htpasswd -bp john
在上述命令后按Enter键时,它会要求您输入一个密码,该密码将作为文本存储在htpasswd
文件中。
答案 1 :(得分:-1)
步骤1-转到加密密码生成器
第2步 - 从网站
生成加密密码的副本步骤3 - 在您的域
下的根文件夹中创建.htpasswd文件第4步 - 在此写下您的用户名:encypted password pair
对于eg-john的/ *:在这里粘贴你的加密密码(冒号后) 约翰:djfj223dv98vufhhy * /