Add the following two lines to the access directory where you want to restrict the user
The code is as follows
Copy Code
Auth_basic "Enter username and password";Auth_basic_user_file nginx_passwd;
HTPASSWD
I have explained how to create a wireless route for Raspberry Pi. I feel that every time I run the command ssh to manage it, I wrote a Web interface by myself, I mainly use CGI programs written in Python. Here I use mini_httpd, a lightweight Web
Hrf:https://www.cnblogs.com/f-ck-need-u/p/8413490.html
HTPASSWD is used to generate a password based on Web user authentication for a specified user, provided by the Httpd-tools package. Supports 3 encryption algorithms: MD5, Sha, and the Crypt ()
The final effect is similar (different browsers have different interfaces ):
If the authentication fails, an HTTP error 401 Authorization Required will be reported.
To implement this function, you need to change the server configuration and set the
Before I explained how to make the raspberry pie (raspberry Pi) to make no line, feeling every time through the command SSH management trouble, so I write the Web interface, mainly using Python CGI program, where the use of MINI_HTTPD this
The final effect is similar (different browser interfaces vary):
If authentication fails, an HTTP error is reported: 401 Authorization Required.
To do this, you need to change the server configuration and set the username and password for the
HTPASSWD is used to generate a password based on Web user authentication for a specified user, provided by the Httpd-tools package. Supports 3 encryption algorithms: MD5, Sha, and the Crypt () function on the system, which defaults to MD5 when no
Sometimes you need to obtain the content of the. htpasswd file, you can use the following code class. if you need it, you can refer to the. htpasswd File example:
User1: {SHA} kGPaD671VNU0OU5lqLiN/h6Q6ac =
User2: {SHA} npMqPEX3kPQTo + x/+ ZckHDrIcQI
Sometimes you need to obtain the content of the. htpasswd file, you can use the following code class. if you need it, you can refer to the. htpasswd File example:
User1: {SHA} kGPaD671VNU0OU5lqLiN/h6Q6ac =
User2: {SHA} npMqPEX3kPQTo + x/+ ZckHDrIcQI
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.