cntlm错误:打开的文件太多

时间:2015-12-11 12:04:19

标签: c networking configuration proxy mint

正如标题所说,我对Cntlm有一些问题。我正在使用0.92.3版本并从源代码启动。我要做的是将Cntlm作为具有localhost配置的独立代理启动,以浏览互联网并启动应用程序(例如Skype)。

我正在研究Mint,命令uname -a给出了:

Linux Jarvis 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

这是我在问之前所做的步骤:

./configure
make
sudo make install
一切都很顺利。我还用以下方法导出http,https和ftp代理:

export http_proxy = http://127.0.0.1:3128 
export https_proxy = https://127.0.0.1:3128 
export ftp_proxy = https://127.0.0.1:3128

一切都很好。剩下的就是启动cntlm,使用:

sudo cntlm -v -f

它正确保存 cntlm.conf 传递的信息,并显示它停留在前台。

我进入浏览器(firefox)并为代理配置它,将127.0.0.1设置为http代理,将3128设置为端口。

当我启动浏览器选项卡并在代理下进行测试研究时,终端开始详细说明数据,但几秒钟后它就一直说:

cntlm[11605]: Serious error during accept: Too many open files

直到我按ctrl + C.

这是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    myUsername
Domain      localhost
Password    password
# NOTE: Use plaintext password only at your own risk
# Use hashes instead. You can use a "cntlm -M" and "cntlm -H"
# command sequence to get the right config for your environment.
# See cntlm man page
# Example secure config shown below.
# PassLM          1AD35398BE6565DDB5C4EF70C0593492
# PassNT          77B9081511704EE852F94227CF48A793
### Only for user 'testuser', domain 'corp-uk'
# PassNTLMv2      D5826E9C665C37C80B53397D5C07BBCB

# Specify the netbios hostname cntlm will send to the parent
# proxies. Normally the value is auto-guessed.
#
# Workstation   netbios_hostname

# List of parent proxies to use. More proxies can be defined
# one per line in format <proxy_ip>:<proxy_port>
#

Listen      127.0.0.1:3128
#Listen     192.168.0.1:3128

#Proxy      10.0.0.41:8080
#Proxy      10.0.0.42:8080
Proxy       127.0.0.1:3128

# List addresses you do not want to pass to parent proxies
# * and ? wildcards can be used
#
NoProxy     localhost, 127.0.0.*, 10.*, 192.168.*

# Specify the port cntlm will listen on
# You can bind cntlm to specific interface by specifying
# the appropriate IP address also in format <local_ip>:<local_port>
# Cntlm listens on 127.0.0.1:3128 by default
#

# If you wish to use the SOCKS5 proxy feature as well, uncomment
# the following option. It can be used several times
# to have SOCKS5 on more than one port or on different network
# interfaces (specify explicit source address for that).
#
# WARNING: The service accepts all requests, unless you use
# SOCKS5User and make authentication mandatory. SOCKS5User
# can be used repeatedly for a whole bunch of individual accounts.
#
SOCKS5Proxy 5000
#SOCKS5User username:password

# 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
# Specifiy individual IPs or subnets one rule per line.
#

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/

# Tunnels mapping local port to a machine behind the proxy.
# The format is <local_port>:<remote_host>:<remote_port>
# 
#Tunnel     11443:remote.com:443

我多次尝试改变配置,但它确实没有改变。如果我把127.0.0.1:3128作为默认代理(我正在尝试做的)它开始很好但是以循环结束。

我该怎么做才能使它有效?问题出在哪里?提前谢谢。

1 个答案:

答案 0 :(得分:1)

请参阅thisthis

很明显,您将获得此配置的循环!你保持你的侦听和代理端口是一样的!所以无论它听什么代理自我,它是累积的!

在代理服务器中输入Windows代理服务器名称和端口!不是你当地的主人!

Username    Enter-your-username-here
Domain      Enter-your-domain-here
Password    Enter-your-password-here

Proxy       proxyhost:proxyport
Proxy       proxyhost:proxyport

NoProxy     localhost,127.0.0.1

Listen      3128

即。如果你想让maven使用cntlm,请将localhost:3128放在maven settings.xml中,这样它就会获得你的proxyhost的代理:带有已定义的域用户名和passowrd的proxyport。