Apache htpasswd Option Parameters
htpasswd [-CMDPSD] passwordfile username
HTPASSWD-B[CMDPSD] passwordfile username password
Htpasswd-n[mdps] Username
HTPASSWD-NB[MDPS] Username password
Apache htpasswd command Option parameter description
-C Create an encrypted file
-N Do not update encrypted files, only the Apache htpasswd command encrypted user name password displayed on the screen
-M default Apache HTPASSSWD command encrypts passwords using the MD5 algorithm
The-D Apache htpassswd command encrypts the password using the crypt algorithm
-P Apache htpassswd command does not encrypt the password, that is, the plaintext password
-S Apache htpassswd command uses the SHA algorithm to encrypt passwords
-B Enter the user name and password in the Apache HTPASSSWD command line instead of the prompt to enter the password
-D Delete the specified user
In Windows, the '-m ' option in the NetWare and TPF system is default and can be ignored when using the Apache htpasswd command. In other systems, the '-P ' option may not work.
Apache HTPASSWD Example
1, how to use the HTPASSWD command to add users?
HTPASSWD-BC. passwd Tonyzhang Pass
Generate a. passwd file in the bin directory, username tonyzhang, password: pass, by default MD5 encryption method
2, how to add the next user in the original password file?
Htpasswd-b. passwd Onlyzq Pass
Remove the C option to add a second user after the first user, and so on
3, how to not update the password file, only display the encrypted user name and password?
HTPASSWD-NB Tonyzhang Pass
Do not update the. passwd file, only the user name and encrypted password are printed on the screen
4, how to use the htpasswd command to delete the user name and password?
htpasswd-d. passwd Tonyzhang
5, how to use the HTPASSWD command to change the password?
htpasswd-d. passwd Tonyzhang
Htpasswd-b. passwd Tonyzhang Pass
That is, use the htpasswd Delete command to delete the specified user, and then use the htpasswd Add User command to create a user can implement the ability to modify the password.
Reference post: http://onlyzq.blog.51cto.com/1228/557593/
Apache htpasswd Command