如何使用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
    评论
配置Docker网络代理,你可以参考Docker官方文档中的配置方法。首先,你需要确定要使用代理服务器的地址和端口。如果你使用的是本地代理,比如localhost:3128,你需要在docker命令中添加--network host参数。这样Docker容器将能够正常使用本地代理。如果你使用的是外部IP地址的代理服务器,并且代理本身需要开启Gateway模式,你需要在Docker守护进程的配置文件中添加代理设置。具体的配置方法可以参考Linux下安装配置Cntlm代理的教程。完成配置后,你需要重启Docker守护进程使配置生效。你可以使用以下命令来重启Docker守护进程并查看配置是否正确: sudo systemctl daemon-reload sudo systemctl restart docker systemctl show --property=Environment docker /etc/systemd/system/docker.service.d 这样你就成功配置了Docker的网络代理。请根据你的实际情况进行相应的配置。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [快速设置 Docker 的三种网络代理配置](https://blog.csdn.net/peng2hui1314/article/details/124267333)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [Docker 配置网络代理](https://blog.csdn.net/qq_39698985/article/details/123748820)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值