目录
Dante-server实现
1.更新系统并安装 Dante-server
sudo apt update
sudo apt upgrade -y
sudo apt install dante-server -y
2. 配置 Dante-server
sudo nano /etc/danted.conf
logoutput: syslog
internal: 0.0.0.0 port = 1080 # 监听所有接口
external: eth0
socksmethod: username # 使用新关键字 `socksmethod` 替代 `method`
user.privileged: root
user.unprivileged: nobody
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: error
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: error
}
3. 创建认证用户(若需用户名/密码)
如果启用了 socksmethod: username,需创建用户并设置密码:
sudo useradd -r -s /bin/false user1080 # 用户名为 user1080
sudo passwd user1080 # 设置密码
4.启动 Dante 并设置开机自启
sudo systemctl start danted
sudo systemctl enable danted
5.检查服务状态
sudo systemctl status danted
或检查端口是否监听:
sudo netstat -tulnp | grep 1080
6.客户端连接测试
curl --socks5-hostname 服务器ip:1080 --proxy-user user1080:pwd1080561365 http://ifconfig.me
如果curl不通,从以下几个方面排除:
1)防火墙放行端口
sudo ufw allow 1080/tcp
2)服务器实例防火墙设置
添加放行规则
3)先服务器本机上测试
4)再在其它服务器上测试/本地电脑上测试
6.连接代理服务器
利用客户端工具配置socks5,进行代理的连接。
0 条评论