How to Install and Configure Cntlm Proxy on Linux and Windows
Learn how to install Cntlm on Debian‑based Linux or Windows, configure its authentication and proxy settings, obtain NTLM hashes, and apply changes by reloading or restarting the systemd service, enabling secure multi‑user HTTP proxy access within restricted networks.
Installation
On Debian‑based systems install cntlm with the package manager: sudo apt install cntlm On other Linux distributions the process is similar. Cntlm is also available for Windows and can be installed via choco:
choco install cntlmConfiguration
After installation the default configuration file is /etc/cntlm.conf. Edit it to set your credentials and proxy information. A minimal example:
Username USERNAME
Domain COMPANY_DOMAIN
Password ********
Proxy proxy.company.com:8080
Proxy proxy2.company.com:8080
NoProxy localhost, 127.0.0.*, 10.*, 192.168.*, .company.com
Listen 3128Note: Replace USERNAME, DOMAIN, and proxy addresses with values that match your environment. If you obtain the NTLM hash in the next step, the Password line can be omitted.
To allow other machines to use the proxy, add Gateway yes to the file. Gateway yes You can also restrict external access with Allow and Deny lists:
Allow 127.0.0.1
Deny 0/0Obtaining Auth
After editing the configuration, run cntlm in verbose mode to retrieve the NTLM hashes:
sudo cntlm -vc /etc/cntlm.conf -M http://baidu.comThe output includes PassNT and PassLM values.
Adding Auth to Configuration
Insert the retrieved hashes into /etc/cntlm.conf:
Auth NTLM
PassNT 7FA051B4B85F0E7EEBB24D3CD73E52B9
PassLM 23A1E1A7276E84EA4846D4C9FF957C31Reload or Restart
When installed from a package, cntlm is managed by systemd and starts on boot. Reload the service to apply changes: sudo systemctl reload cntlm If reloading does not take effect, restart the service:
sudo systemctl restart cntlmSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
