Apache htpasswd command

Source: Internet
Author: User

Apache htpasswd option Parameters

Htpasswd [-javaspsd] passwordfile username

Htpasswd-B [javaspsd] passwordfile username password

Htpasswd-n [mdps] username

Htpasswd-nb [mdps] username password

Parameters of the apache htpasswd command

-C. Create an encrypted file

-N: If the encrypted file is not updated, only the user name and password encrypted by the apache htpasswd command are displayed on the screen.

-M by default, the apache htpassswd command uses the MD5 Algorithm to encrypt the password.

-D the apache htpassswd command uses the CRYPT algorithm to encrypt the password.

-P apache htpassswd command does not encrypt the password, that is, the plaintext Password

-S apache htpassswd command uses SHA algorithm to encrypt the password

-B enters the user name and password in the apache htpassswd command line instead of entering the password as prompted.

-D. Delete the specified user.

In Windows, the '-m' option is the default in NetWare and TPF systems. You can ignore it 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 a user?

Htpasswd-bc. passwd tonyzhang pass

Generate a. passwd file in the bin directory, with the username tonyzhang and password: pass. MD5 encryption is used by default.

2. How to add the next user to the original password file?

Htpasswd-B. passwd onlyzq pass

Remove the c option to add a second user after the first user.

3. How can I only display the encrypted user name and password without updating the password file?

Htpasswd-nb tonyzhang pass

Do not update the. passwd file. Only output the user name and encrypted password on the screen.

4. How can I use the htpasswd command to delete the user name and password?

Htpasswd-D. passwd tonyzhang

5. How can I use the htpasswd command to change the password?

Htpasswd-D. passwd tonyzhang

Htpasswd-B. passwd tonyzhang pass

You can use the htpasswd DELETE command to delete a specified user, and then use the htpasswd add USER command to create a user to change the password.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.