如何使用cntlm配置代理上网

问题:

公司网络使用了域账号管理机制,上网必须配指定的机器名和域名,最头痛的是还需要密码,访问网站经常弹出输入用户名密码的窗口,很多软件都不能自动升级。


解决办法:

是使用 Cntlm Authentication Procxy进行代理的转换,把公司的代理转成本地的标准代理。这样虚拟机内部的系统也就可以上网了^_^。而且使用了cntlm以后,公司的限制就没有了 哈哈

下面介绍配置方式:

软件官网:http://cntlm.sourceforge.net/ 是开源的哦!可以在linux和window下运行。

windows版本:http://ftp.awk.cz/cntlm/win32/cntlm-0.91rc6-setup.exe 

 

安装windows版:

1、下载cntlm-0.91rc6-setup.exe。

2、默认安装到"C:\Program Files\Cntlm",不要改变目录否则服务启动不了。


3、修改配置文件cntlm.ini

第8行 设定基本信息

Username 你的域用户名
Domain   公司分配的域名
Password 登录域密码

第29行 代理信息

Proxy  公司代理ip:端口

其余默认即可,如下图。


红色框选的内容是必须要有的配置

4、启动服务

点击开始菜单->cntlm->Start Cntlm Authentication Proxy即可启动服务

 

配置上网:

打开ie浏览器,设置代理上网方式为127.0.0.1:3128

3128是Cntlm服务使用的端口号,在cntlm.ini里面有默认的配置,也可以修改。

ok,下面就可以上网啦!!!

=======================================

LINUX系统下:

1.下载并安装cntlm-0.35.1.tar.gz

sudo ./configure

sudo make

sudo make install

2.修改配置文件

sudo vi /usr/local/etc/cntlm.conf

用户名

密码

workstation :liyang9

代理

3.设置cntlm的环境变量(可通过界面 network proxy)

   将

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

写入~/.bash_profile

4.启动cntlm 命令sudo cntlm -c /usr/local/etc/cntlm.conf &  //最好将这一句加到/etc/rc.local启动项中,免得每次开机都要运行一下。

================================guoliang  ‘s   doc =========================

This is the basic procedure to install cntlm on your GNU/Linux machine.
1、Download the source tarball from http://cntlm.sourceforge.net
2、Unzip with tar -vxzf <path-to-tarball>.
3、cd into the resulting directory.
4、Run ./configure.This will install cntlm in /usr/local.
5、Edit the Makefile. Replace SYSCONFDIR=/usr/local/etc by SYSCONFDIR=/etc
6、Type make
7、Type sudo make install
8、Edit the /etc/cntlm.conf file as mentioned in the end.
9、do: $chmod 644 /etc/cntlm.conf as root.  Since the /etc/cntlm.conf was created by root, chances are that, cntlm will not be able to access the file. 
10、Then, start cntlm by typing : cntlm&  (有时配置会有错误,因此建议使用cntlm -v先查看是否可以启动成功,不成功则检查错误,如果确认可以启动成功后,ctrl+c取消当前进程,再输入cntlm&进入后台运行模式)




11、添加代理变量。
对于redhat,ubuntu以及fedora等常用linux系统,均有设置网络代理(network proxy)的菜单项,在里面代理地址上填写127.0.0.1,代理端口填写自己设置的端口数字,默认为3128。应用到整个系统,重启已经打开的终端即可(为了读取配置的网络代理变量值)。



如果使用的普通定制的linux系统不支持界面设置网络代理,则按以下操作:
根据自己实际的端口号或者IP地址分别替换3128或者localhost(如果是本机,localhost不用替换),具体端口号见/etc/cntlm.conf
export http_proxy=http://localhost:3128/
export https_proxy=${http_proxy}
export ftp_proxy=${http_proxy}

不想每次打开终端都有添加一次,可以把以上三行添加到用户目录下面的.bash_profile的最后


12、通过测试wget URL测试连接是否成功,URL用具体的网址替换,例如http://www.baidu.com


13、Reference: http://iitmlug.a.wiki-site.com/index.php/Cntlm


/etc/cntlm.conf


###start cntlm.conf
#
# Cntlm Authentication Proxy Configuration
#
# NOTE: all values are parsed literally, do NOT escape spaces,
# do not quote. Use 0600 perms if you use plaintext password.
#




Username <your username>  #代理用户名,海信为邮箱前缀
Domain iitm.ac.in       #域名,海信为hisense.ad
Password <your password># Use hashes instead (-H)密码
Workstation netbios_hostname# Should be auto-guessed主机名,海信的填写与用户名一致


Proxy hproxy.iitm.ac.in:3128   #验证代理的地址和端口,海信的这样填写172.16.2.101:80
#Proxy 10.217.112.42:8080


#
# This is the port number where Cntlm will listen
#
Listen <your choice of port here>      #自己的配置端口


#
# Use -M first to detect the best NTLM settings for your proxy.
# Default is to use the only secure hash, NTLMv2, but it is not
# as available as the older stuff.
#
# This example is the most universal setup known to man, but it
# uses the weakest hash ever. I won't have it's usage on my
# conscience. :) Really, try -M first.
#
Auth LM #授权类型
#Flags 0x06820000


#
# Enable to allow access from other computers
#
#Gateway yes


#
# Useful in Gateway mode to allow/restrict certain IPs
#
#Allow 127.0.0.1
#Deny 0/0


#
# GFI WebMonitor-handling plugin parameters, disabled by default
#
#ISAScannerSize 1024
#ISAScannerAgent Wget/
#ISAScannerAgent APT-HTTP/
#ISAScannerAgent Yum/


#
# Headers which should be replaced if present in the request
#
#Header User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)


#
# Tunnels mapping local port to a machine behind the proxy

#Tunnel 1122:awk.cz:443
##end cntlm.conf




2011.12.10修改  by liang guo
 

  • 4
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
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、付费专栏及课程。

余额充值