Debian设置Squid http代理

发布于 2023-10-13  1060 次阅读


安装Squid

sudo apt-get install squid3
sudo apt-get install apache2-utils

设置账户密码

sudo touch /etc/squid/passwords
sudo chmod 777 /etc/squid/passwords
sudo htpasswd -c /etc/squid/passwords 用户名
回车后输入密码

配置Squid代理

sudo mv /etc/squid/squid.conf /etc/squid/squid.conf.original
把下面的内容写到/etc/squid/squid.conf里面,然后sudo systemctl restart squid.service
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 24 hours
auth_param basic casesensitive off
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
http_access deny all
dns_v4_first on
forwarded_for delete
via off
http_port 8888


一沙一世界,一花一天堂。君掌盛无边,刹那成永恒。