Ubuntu或Centos下一键安装socks5代理脚本

很多时候ss并不能很好的解决特殊问题。

直入主题:
下载脚本:

wgetno-check-certificate https://raw.github.com/Lozy/danted/master/install.sh -O install.sh

安装:

chmod +x install.sh && ./install.sh –port=端口 –user=自己设置用户名 –passwd=设置密码

 

安装成功
成功后会出现:Dante Server Install Successfuly!

用的是dente-server ubuntu可以直接apt install dente-server,但是配置文件需要手动修改。这个只是为了方便

 

具体更多用法输入:/etc/init.d/sockd

Usage: /etc/init.d/sockd {start|stop|restart|reload|status|state|adduser|deluser|tail|conf|update}

还有种办法是去官网下载最新版编译然后安装

wget https://www.inet.no/dante/files/dante-1.4.2.tar.gz
tar xf dante-1.4.2.tar.gz
cd dante-1.4.2
autoreconf --install --force
./configure
make install

创建并编辑/etc/sockd.conf,修改为如下,

#/etc/sockd.conf
 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.
 The default of "none" permits anonymous access.
 socksmethod: username
 client-rules determine who can connect to the internal interface.
 The default of "none" permits anonymous access.
 clientmethod: none
 client pass {
     from: 0.0.0.0/0 to: 0.0.0.0/0
     #log: connect disconnect error
 }
 socks pass {
     from: 0.0.0.0/0 to: 0.0.0.0/0
     #log: connect disconnect error
 }

将上述配置文件中的external修改为VPS实际的流量出口interface(网卡),端口1080随便修改,创建一个用户并修改密码,用于,赋予最低的权限。

useradd -r -s /bin/false USERNAME //创建用来socks登录的账号
passwd USERNAME //修改该账号密码,用作socks代理登录密码

使用内置的-V命令测试sockd.conf文件是否正确,若正确则无任何输出

sockd -V

直接以daemon模式运行即可

sockd -D

其他更多帮助信息,-h查看

sockd -h