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/

完毕


                
  • 7
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 14
    评论
要在Ubuntu上安装socks5代理服务器,可以按照以下步骤进行操作: 1. 首先,更新软件源列表,可以使用以下命令: ``` sudo apt update ``` 2. 安装dante-server软件包,它是一个常用的socks5代理服务器软件包,可以使用以下命令进行安装: ``` sudo apt install dante-server ``` 3. 在安装之前,可以先备份原有的配置文件,以防止出现问题。可以使用以下命令备份配置文件: ``` sudo mv /etc/danted.conf /etc/danted.conf.bak ``` 4. 打开配置文件并编辑,可以使用以下命令打开一个空的配置文件: ``` sudo nano /etc/danted.conf ``` 5. 将以下内容粘贴到配置文件中: ``` logoutput: stderr internal: <本机ip> port = <端口,通常为1080> external: <本机ip> method: none user.privileged: root user.notprivileged: nobody user.libwrap: nobody compatibility: sameport compatibility: reuseaddr extension: bind client pass { from: 0.0.0.0/0 to: 0.0.0.0/0 log: connect disconnect error } pass { from: 0.0.0.0/0 to: 0.0.0.0/0 command: bind log: connect disconnect error } pass { from: 0.0.0.0/0 to: 0.0.0.0/0 command: bindreply udpreply log: connect error } pass { from: 0.0.0.0/0 to: 0.0.0.0/0 port 1-65535 protocol: tcp udp } pass { from: 0.0.0.0/0 to: 0.0.0.0/0 port 1-65535 command: udpassociate } ``` 6. 保存并关闭配置文件。 完成以上步骤后,你的Ubuntu系统上就安装好了socks5代理服务器。你可以根据自己的需求修改配置文件中的参数,然后启动dante-server服务即可使用socks5代理。 #### 引用[.reference_title] - *1* [Ubuntu搭建socks5服务](https://blog.csdn.net/m0_37340681/article/details/120316561)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Tiyo

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

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

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

打赏作者

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

抵扣说明:

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

余额充值