gpt4 book ai didi

基于Ubuntu服务器配置原生的Socks5网关代理服务器

转载 作者:我是一只小鸟 更新时间:2023-02-10 22:31:32 25 4
gpt4 key购买 nike

常见的代理协议有 http、https、socks4/5 这三种,http协议的代理搭建方案最简单,但是http代理无法访问https网站,https代理无法实现调用远端dns,所以我个人推荐使用Scoks5协议做代理,本文用于记录在Ubuntu系统中搭建Socks5代理的详细步骤,采用dante-server作为服务端.

首先更新服务器安装源 sudo apt-get update 。

执行安装命令 sudo apt-get install dante-server 。

添加一个用户用于进行连接代理时的身份验证 。

sudo useradd zhangxiaodong 。

sudo passwd zhangxiaodong 。

由于我们只想使用这个用户用作Socks的代理登陆验证,所以禁止这个用户的系统登陆权限 。

sudo vim /etc/passwd 。

将zhangxiaodong的shell改成 /bin/false,如下图 。

sudo vim /etc/danted.conf 。

清空原来的内容输入以下内容 我这边的服务器网卡IP为 172.16.50.1,并采用 1080 作为代理端口则配置如下 。

                        
                          logoutput: stderr

internal: 172.16.50.1  port = 1080

external: 172.16.50.1

#验证账户:username  不验证账户:none
method: username

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
}

                        
                      

保存退出即可,然后执行启动 sudo /etc/init.d/danted start 。

查看服务运行状态 sudo netstat -anp | grep 1080 。

至此关于 基于 Ubuntu 服务器配置原生的 Socks5 网关代理服务器 就讲解完了,有任何不明白的,可以在文章下面评论或者私信我,欢迎大家积极的讨论交流,有兴趣的朋友可以关注我目前在维护的一个 .NET 基础框架项目,项目地址如下 https://github.com/berkerdong/NetEngine.git https://gitee.com/berkerdong/NetEngine.git 。

最后此篇关于基于Ubuntu服务器配置原生的Socks5网关代理服务器的文章就讲到这里了,如果你想了解更多关于基于Ubuntu服务器配置原生的Socks5网关代理服务器的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com