Apache htpasswd Command

Source: Internet
Author: User

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

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.