有时候,svn或者nginx的简单验证的地方需要htpasswd生成的密码。
[root@test tmp]# htpasswd -nbm passwd test 1234
Usage:
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password
htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
-c Create a new file. # 创建一个新的文件
-n Don't update file; display results on stdout. # 直接输出产生的结果,无需写入或者更新文件。
-m Force MD5 encryption of the password.# 采用md5哈希
-d Force CRYPT encryption of the password (default).
-p Do not encrypt the password (plaintext).
-s Force SHA encryption of the password.
-b Use the password from the command line rather than prompting for it. # 密码会放在命令行里。
-D Delete the specified user. # 删除某个账户
- 有一个种,直接生成的方式,结果会直接显示出来,然后只需要把它粘贴到相应的passwd里面就好了。
htpasswd -nbm user1 passwd1
本文介绍了如何使用htpasswd命令来生成密码。包括不同选项的意义及用法,如-n、-m、-d等,并展示了如何创建密码文件以及如何直接输出密码而不进行文件存储。
554

被折叠的 条评论
为什么被折叠?



