步骤如下:
- 安装dante
sudo apt-get install dante-server -y
- 配置 Dante SOCKS5 服务器
vim /etc/danted.conf
# /etc/danted.conf
logoutput: /var/log/socks.log
internal: 0.0.0.0 port = 1080 # 可以自己修改端口
external: eth0
method: username none # 认证方式:用户名+密码 或 none 表示无认证
user.privileged: root
user.notprivileged: nobody
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 connect udpassociate
log: connect disconnect error
}
- 设置用户名密码认证(可选)
创建用于 SOCKS5 登录的用户(例如:socksuser):
sudo adduser socksuser
输入密码即可。这个用户将用于连接 SOCKS5 代理时的身份验证。
注意:如果不需要密码认证,可以跳过此步,并保持 method: none。
- 启动并启用 Dante 服务
sudo systemctl enable danted
sudo systemctl start danted
查看运行状态:
sudo systemctl status danted