如何避免Debian客户端多处保存代理密码?

Debian-Like

1 前言

一个问题,一篇文章,一出故事。
笔者公司的域密码策略很敏感,每次改密码,稍有不慎10分钟后域账号就会被锁。
原因是因为这些密码分散保存在浏览器、系统、VDI、某些软件的上网代理配置中,笔者之前的解决方案是根据日志等信息的提示或记忆中在哪里保存过密码去清除设备上的账号或缓存,有时候因为一个长期回忆不起来的密码保存应用而反复折腾,实在耗费心神。
于是笔者为避免此类问题发生,于是将自己的主机配置为正向代理的免密码接入点。

2 最佳实践

2.1 安装Squid

apt install -y squid

2.2 创建代理配置

cp /etc/squid/squid.conf /etc/squid/squid.conf.defautl
vim /etc/squid/squid.conf
cache_peer 192.168.0.1 parent 8080 0 no-query default login=username:password

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
http_access allow localhost
http_access deny all
never_direct allow all

http_port 3128

coredump_dir /var/spool/squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

2.3 重载服务使用配置生效

systemctl reload squid

2.4 客户端配置

export proxy='http://127.0.0.1:3128'
export http_proxy="$proxy"
export https_proxy="$proxy"
export ftp_proxy="$proxy"
export no_proxy="cmdschool.org localhost, 127.0.0.1, ::1"
curl https://www.baidu.com

注:以上只是范例,将所以需要用到代理的应用全部指向本机的代理即可,密码由本机代理统一管理,避免多点保存密码锁账号。

没有评论

发表回复

Debian-Like
如何安装Debian LibreOffice?

1 前言 一个问题,一篇文章,一出故事。 笔者最近发现FreeOffice需要注册,因此决定还是安装 …

Debian-Like
如何安装Debian FreeOffice

1 前言 一个问题,一篇文章,一出故事。 笔者最近发现FreeOffice貌似不错,于是想试用,于是 …

Debian-Like
如何熟悉Nikto Web服务器扫描工具?

1 前言 一个问题,一篇文章,一出故事。 笔者最近需要加固网站的安全,因此需要一个得力的Web服务器 …