CentOS7/Debian 配置SOCKS5代理服务记录
作者:互联网
CentOS7:
yum install gcc openldap-devel pam-devel openssl-devel
Debian【问题不少,还没安装成功,最后使用一键脚本才行】
apt-get install gcc pam-dev libpam0g-dev
apt-get install libldap2-dev
apt-get install openssl
apt-get install libssl-dev
apt-get install make
https://blog.liyuans.com/archives/socks5-dante.html/comment-page-1
https://github.com/Lozy/danted
一键安装
下载脚本
wget --no-check-certificate https://raw.github.com/Lozy/danted/master/install.sh -O install.sh
安装
bash install.sh --port=端口 --user=自己设置用户名 --passwd=设置密码
安装成功
成功后会出现:Dante Server Install Successfuly!
主要安装:
wget http://jaist.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz
tar -vzx -f ss5-3.8.9-8.tar.gz
cd ss5-3.8.9/
./configure
make && make install
修改SS5配置文件
修改认证方式 /etc/opt/ss5/ss5.conf,查找取消下面两行注释
auth 0.0.0.0/0 - -
permit - 0.0.0.0/0 - 0.0.0.0/0 - - - - -
安装后这两行是注释的,默认的是:无用户认证。如果想要使用 username/password,用户认证方法,需要将上面两行修改成下面这样:
auth 0.0.0.0/0 - u
permit u 0.0.0.0/0 - 0.0.0.0/0 - - - - -
添加用户名及密码 /etc/opt/ss5/ss5.passwd,每行一个用户+密码(之间用空格)
root rootroot
修改ss5启动的参数,自定义代理端口(如果不设置,默认是1080)
方法一
编辑/etc/sysconfig/ss5,将
#SS5_OPTS=” -u root”
取消注释,修改成下面这样
SS5_OPTS=" -u root -b 0.0.0.0:10080"
方法二 :以 root 身份运行 SS5 并修改端口为 10080(默认端口 1080)
在vim /etc/init.d/ss5中添加如下行
export SS5_SOCKS_PORT=10080
export SS5_SOCKS_USER=root
给bash文件增加可执行权限 /etc/rc.d/init.d/ss5
chmod 755 /etc/rc.d/init.d/ss5
启动与关闭ss5
一定要在root用户目录下,执行
/etc/rc.d/init.d/ss5 restart
/etc/rc.d/init.d/ss5 stop
也可以用
service ss5 start
service ss5 stop
启动完成后,可以使用以下命令查看连接情况
netstat -an | grep 10080
查看日志
more /var/log/ss5/ss5.log
将ss5加入开机自动启动(可选)
chkconfig --add ss5
chkconfig --level 345 ss5 on
/etc/rc.d/init.d/ss5 start
/etc/rc.d/init.d/ss5 restart
/etc/rc.d/init.d/ss5 stop
service ss5 start
service ss5 stop
service ss5 restart
关闭防火墙
systemctl stop firewalld.service
开启防火墙:
systemctl start firewalld.service
开启开机启动:
systemctl enable firewalld.service
关闭开机启动:
systemctl disable firewalld.service
遇到的错误:
debian查看ip:ip address show
Media change: please insert the disc labeled
'Debian GNU/Linux 9.4.0 _Stretch_ - Official amd64 DVD Binary-1 20180310-11:21'
in the drive '/media/cdrom/' and press [Enter]
当没有时就无法进行安装了, 这时可以打开文件/etc/apt/sources.list文件,注释掉cdrom那一行
configure: error: *** Some of the headers weren't found ***
缺某些库文件, 我看到和pam有关的, 是pam-devel包
coentOS:
# yum -y install pam-devel
Debian:
apt-get install libpam-dev
root@debian:/etc/apt/ss5-3.8.9# make
make[1]: Entering directory '/etc/apt/ss5-3.8.9/common'
gcc -g -O2 -DLINUX -D_FILE_OFFSET_BITS=64 -I . -I ../include -fPIC -c -o SS5OpenLdap.o SS5OpenLdap.c
SS5OpenLdap.c:29:18: fatal error: ldap.h: No such file or directory
#include <ldap.h>
^
compilation terminated.
<builtin>: recipe for target 'SS5OpenLdap.o' failed
make[1]: *** [SS5OpenLdap.o] Error 1
make[1]: Leaving directory '/etc/apt/ss5-3.8.9/common'
Makefile:23: recipe for target 'common' failed
make: *** [common] Error 2
参考:https://blog.csdn.net/u010487568/article/details/49700831
make[2]: Entering directory '/etc/apt/ss5-3.8.9/modules/mod_authen'
gcc -g -O2 -DLINUX -D_FILE_OFFSET_BITS=64 -I . -I ../../include -shared -fPIC -c -o SS5Supa.o SS5Supa.c
SS5Supa.c: In function ‘ss5_secure_dh_compute_key’:
SS5Supa.c:208:5: error: dereferencing pointer to incomplete type ‘DH {aka struct dh_st}’
ss->p = BN_bin2bn ((pippo->p), pippo->lenp, NULL);
^~
SS5Supa.c: In function ‘ss5_secure_dh_decrypt_key’:
SS5Supa.c:342:3: warning: implicit declaration of function ‘DES_ede3_cbcm_encrypt’ [-Wimplicit-function-declaration]
DES_ede3_cbcm_encrypt (pippo, pippo_crypt, l, &schedule1, &schedule2, &schedule1, &iv, &iv2, DES_DECRYPT);
^~~~~~~~~~~~~~~~~~~~~
In file included from SS5Supa.c:21:0:
SS5Supa.c: At top level:
../../include/SS5Mod_authentication.h:71:3: warning: inline function ‘S5AuthCacheHash’ declared but never defined
S5AuthCacheHash( char *u,
^~~~~~~~~~~~~~~
<builtin>: recipe for target 'SS5Supa.o' failed
make[2]: *** [SS5Supa.o] Error 1
make[2]: Leaving directory '/etc/apt/ss5-3.8.9/modules/mod_authen'
Makefile:6: recipe for target 'all' failed
make[1]: *** [all] Error 1
make[1]: Leaving directory '/etc/apt/ss5-3.8.9/modules'
Makefile:27: recipe for target 'modules' failed
make: *** [modules] Error 2
参考:https://sourceforge.net/p/ss5/mailman/ss5-discuss/?style=flat
apt-get install slapd ldap-utils 输入两次密码
参考:http://www.tingtao.org/archives/383.html
https://www.cnblogs.com/jins-note/p/9513280.html
Debian 9系统中安装dante socks5的方法
https://ywnz.com/linuxyffq/2950.html
标签:代理服务,ss5,0.0,make,apt,CentOS7,etc,SOCKS5,install 来源: https://blog.csdn.net/yyws2039725/article/details/90746042