cntlm 使用介绍

本文详细介绍cntlm HTTP二级代理软件的配置与使用方法。包括如何设置用户名、密码、监听端口及代理规则,以及如何生成加密密码和重启服务。同时,文章还介绍了如何将cntlm作为http和https的代理,确保网络访问的安全与便捷。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

cntlm 使用介绍

cntlm 是一个HTTP二级代理软件。 它主要的作用,是在能代理上网的前提下,给这个代理再做一个代理,提供给更多的下级用户。 下级用户不需要、也不可能知道代理的账户密码,这样既保障了安全、又实现了方便。

cntlm 配置

安装之后,cntlm 配置主要通过 /etc/cntlm.conf 来实现。其主要内容如下

Username    USERNAME
Domain      COMPANY_DOMAIN
Auth        NTLM
PassNT      ******************
PassLM      ******************

Proxy       proxy.company.com:8080
Proxy       proxy2.company.com:8080

NoProxy     localhost, 127.0.0.*, 10.*, 192.168.*, .company.com

Listen      3128

Gateway yes

Allow       127.0.0.1
#Deny       0/0

上述配置说明:

  • Username:登录的用户名
  • Domain:用户名注册的域
  • Auth,PassNT,PassLM:密码的加密结果
  • Proxy:上层的 proxy 代理
  • NoProxy:不使用代理的 url
  • Listen:cntlm 监听的端口
  • Gateway:yes 允许非本机使用此配置代理
  • Allow,Deny:限制外部访问的白名单和黑名单

修改完之后,使用 cntlm -H 并输入密码即可生成上面配置需要的 Auth,PassNT,PassLM。

cntlm 重启

重新加载配置

sudo systemctl reload cntlm

重新启动服务

sudo systemctl restart cntlm

关联 http/https 访问

将 http_proxy 和 https_proxy 设置为 cntlm 服务

具体修改 $HOME/.bashrc 或者 $HOME/.profile 或者 /etc/profile,在文件最后添加如下内容

export http_proxy=http://localhost:3128
export https_proxy=${http_proxy}
export ftp_proxy=${http_proxy}

 

About Cntlm proxy Cntlm (user-friendly wiki / technical manual) is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy intended to help you break free from the chains of Microsoft proprietary world. You can use a free OS and honor our noble idea, but you can't hide. Once you're behind those cold steel bars of a corporate proxy server requiring NTLM authentication, you're done with. The same even applies to 3rd party Windows applications, which don't support NTLM natively. Here comes Cntlm. It stands between your applications and the corporate proxy, adding NTLM authentication on-the-fly. You can specify several "parent" proxies and Cntlm will try one after another until one works. All auth'd connections are cached and reused to achieve high efficiency. Just point your apps proxy settings at Cntlm, fill in cntlm.conf (cntlm.ini) and you're ready to do. This is useful on Windows, but essential for non-Microsoft OS's. Cntlm integrates TCP/IP port forwarding (HTTP tunneling), SOCKS5 proxy mode, standalone proxy allowing you to browse intranet as well as Internet and to access corporate web servers with NTLM protection. There are many advanced features like NTLMv2 support, password protection, password hashing, completely mutliplatform code (running on just about every architecture and OS out there) and so much more. Cntlm eats up so little resources it can be used on embedded platforms as well - it's written in plain C without any external dependencies. Cntlm has been tested against various ISA servers, WinGate, NetCache, Squid and Tinyproxy with and without NTLM auth. Memory management audits and profiling are inherent part of the development process. Each change in the code is audited using Valgrind, which acts as a virtual CPU and checks behaviour of each instruction of the application being profiled. Using this marvelous tool, you can uncloak any imbalance in malloc/free calls (double free's or leaks), operations with uninitialized memory, access outside of properly allocated memory and oh so much more.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值