参考 https://blog.csdn.net/dddgggd/article/details/122411969
1、安装Squid
yum install squid -y
2、编辑squid配置文件
cd /etc/squid/
vim squid.conf
3、修改内容为
dns_v4_first on
http_port 3228 # 修改端口,默认为 3128
http_access allow all # 添加 ,为允许所有ip
4、启动服务
systemctl start squid
5、加用户名密码
yum install httpd-tools –y
htpasswd -cd /etc/squid/passwd username username改成自己的
6、编辑squid配置文件在最后面加上
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid Basic Authentication
auth_param basic credentialsttl 2 hours
acl auth_users proxy_auth REQUIRED
http_access allow auth_users
7、重启Squid
systemctl restart squid
Comments | NOTHING