View Single Post
Tuổi 26-12-2021, 02:59 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
Hướng dẫn cấu hình Squid proxy chứng thực mật khẩu
Hướng dẫn cấu hình Squid proxy chứng thực mật khẩu


Để xây dựng 1 proxy có chứng thực username, password bạn làm như sau:


sudo yum install squidsudo systemctl start squid

vi /etc/squid/squid.conf

1. Thay đổi port

http_port 8888

2. Cho phép tất cả IP truy cập được proxy

http_access allow all

3. Yêu cầu nhập username, password khi truy cập proxy (lệnh sau để tạo 1 username tên là user1 và pass: 123456 cho proxy)

printf "user1:$(openssl passwd -crypt 123456)\n" | sudo tee -a /etc/squid/htpasswd

Sau đó thêm 4 dòng sau vào /etc/squid/squid.conf
# add these 4 lines
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/htpasswd
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated

Restart lại squid proxy

sudo systemctl restart squid



Tham khảo:



https://shouts.dev/install-and-confi...roxy-on-centos


hoặc


https://www.server-world.info/en/not..._7&p=squid&f=1
  Trả lời ngay kèm theo trích dẫn này