编辑
2024-07-05
Linux
00
请注意,本文编写于 105 天前,最后修改于 105 天前,其中某些信息可能已经过时。

目录

安装danted
配置文件
测试

安装danted

官方地址:Dante

bash
wget https://www.inet.no/dante/files/dante-1.4.2.tar.gz tar -zxvf dante-1.4.2.tar.gz # danted基于c开发,需要c环境 yum install -y gcc
  • 编译安装
sh
./configure --pre^Cx=/usr/local/dante-1.4.2 make && make install

配置文件

sh
logoutput: /var/log/socks.log internal: ip地址 port = 2016 # 将ip地址替换为自己的 external: IP地址 clientmethod: none socksmethod: username user.privileged: root user.notprivileged: root 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 command: bind connect udpassociate log: error connect disconnect socksmethod: username } socks block { from: 0.0.0.0/0 to: 0.0.0.0/0 log: connect error }

测试

bash
# 启动 /usr/local/dante-1.4.2/sbin/sockd -D -f /etc/danted/sockd.conf # 查看是否启动成功 ps -ef | grep danted netstat -nlpt |grep 2016
  • -D:后台运行
  • -f:指定配置文件

image-20240704185653169


sh
# 创建用户 useradd -r -s /bin/false chuntian passwd chuntian # 给个密码 # 访问 curl -v -x socks5://username:password@server-ip:2016 http://www.baidu.com/

image-20240704185858035

本文作者:春天y

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!