DANTED SERVER v1.1.19-在ubuntu上错误配置sock5

时间:2018-11-21 12:42:56

标签: ubuntu

我已经按照本教程dante sock5 configuration进行操作,但是我遇到了一个奇怪的错误。

下面是我的danted.conf文件:

# /etc/danted.conf

logoutput: syslog
user.privileged: root
user.notprivileged: nobody

# The listening network interface or address.
internal: 0.0.0.0 port=1080

# The proxying network interface or address.
external: eth0

# socks-rules determine what is proxied through the external interface.
# The default of "none" permits anonymous access.
socksmethod: username

# client-rules determine who can connect to the internal interface.
# The default of "none" permits anonymous access.
clientmethod: none

client pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect disconnect error
}
socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect disconnect error
}

当我启动但丁服务时,我收到此错误消息:

Starting Dante SOCKS daemon: Nov 21 13:38:09 (1542803889) danted[21175]: /etc/danted.conf: error on line 15, near 's': syntax error

该错误位于“ socksmethod:用户名”行上。

我不知道如何解决....我什至不知道从哪里开始调查...

[现在]

我已解决配置错误,位于我的配置文件下方

# /etc/danted.conf

logoutput: syslog
user.privileged: root
user.notprivileged: nobody

# The listening network interface or address.
internal: 0.0.0.0 port=1080

# The proxying network interface or address.
external: eth0

# socks-rules determine what is proxied through the external interface.
# The default of "none" permits anonymous access.
method: username

# client-rules determine who can connect to the internal interface.
# The default of "none" permits anonymous access.
method: none

socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect disconnect error
}

但是现在我的连接被拒绝

curl -v -x socks5://login:password@ip_adress:1080 http://www.google.com/
*   Trying XX.XX.YYY.ZZZ...
* TCP_NODELAY set
* connect to XX.XX.YYY.ZZZ port 1080 failed: Connection refused
* Failed to connect to XX.XX.YYY.ZZZport port 1080: Connection refused
* Closing connection 0
curl: (7) Failed to connect to XX.XX.YYY.ZZZport port 1080: Connection refused

我的防火墙完全打开 !!

暂时我不明白为什么会有“客户准证”和“袜子准证”...。

也许错误在那里!

请帮助!

谢谢!

1 个答案:

答案 0 :(得分:0)

我认为您可以尝试此配置文件。

检查单打伺服器版本

danted -v

danted-server V1.1

internal: eth0  port = 1080
external: eth0
external.rotation: same-same
socksmethod: pam.username none
clientmethod: none
user.privileged: root
user.notprivileged: sock
logoutput: /var/log/danted.log
client pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: error connect disconnect
}
client block {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect error
}
socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: error connect disconnect
}
socks block {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect error
}

由于danted-server版本过旧,因此您也可以尝试使用新版本的danted-server。 新旧版本的配置文件之间有一些区别。

danted-server V1.4

logoutput: /var/log/socks.log
internal: eth0 port = 1080
external: eth0
clientmethod: none
socksmethod: none
user.privileged: root
user.notprivileged: nobody

client pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: error connect disconnect
}
client block {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect error
}
socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: error connect disconnect
}
socks block {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect error
}

请注意,首先需要创建日志文件。

sudo touch /var/log/socks.log

(以上任何配置文件均未添加帐户密码,您可以更改服务端口XD)