ubuntu 搭建 socks5 真正能用的教程 danted server

别再傻乎乎的搜索了!

昨晚想在不同手机上使用socks5连接(用途秘密),谷歌了一下。。。前面10条中文标题的,都提及了使用 danted,却没有一个能正常开启。文章都是翻来覆去的你抄我炒你。。

真正能用的都是爬了外边文章,话不多说上干货,希望能懂的一步到位!

1: 更新系统

  1. sudo apt update
  2. sudo apt install dante-server

2: 查看 danted运行状态

  1. systemctl status danted.service

状态结果:

Output

● danted.service - SOCKS (v4 and v5) proxy daemon (danted) Loaded: loaded (/lib/systemd/system/danted.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2021-12-15 21:48:22 UTC; 1min 45s ago Docs: man:danted(8) man:danted.conf(5) Main PID: 14496 (code=exited, status=1/FAILURE) Dec 15 21:48:21 proxies systemd[1]: Starting SOCKS (v4 and v5) proxy daemon (danted)... Dec 15 21:48:22 proxies systemd[1]: Started SOCKS (v4 and v5) proxy daemon (danted). Dec 15 21:48:22 proxies danted[14496]: Dec 15 21:48:22 (1639604902.102601) danted[14496]: warning: checkconfig(): no socks authentication methods enabled. This means all socks requests will be blocked after negotiation. Perhaps this is not intended?

如有报错,先自行解决安装问题。

3: 修改配置文件

  1. sudo nano /etc/danted.conf

4: 直接复制如下代码到配置文件!!度娘找到的没一个能用!

logoutput: syslog
user.privileged: root
user.unprivileged: 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.
socksmethod: username

# client-rules determine who can connect to the internal interface.
clientmethod: none

client pass {
    from: 0.0.0.0/0 to: 0.0.0.0/0
}

socks pass {
    from: 0.0.0.0/0 to: 0.0.0.0/0
}

5: 系统开放端口,后面1080就是端口,跟上面配置文件中的1080对应

  1. sudo ufw allow 1080

6: 为连接新增用户,禁用登录,把“用户名”修改为英文登录名称

  1. sudo useradd -r -s /bin/false 用户名
  2. sudo passwd 用户名

7: 重启服务

  1. sudo systemctl restart danted.service

8: 再次检测运行状态

  1. systemctl status danted.service

9: 重点!!!测试

A:输入如下命令浏览任何网址,如返回正常网页代码,即成功
  1. curl -v -x socks5://用户名:密码@服务器地址:端口 http://www.任意网址.com/

完毕


                
评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Tiyo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值