搭建socks5服务器

源码编译
550
linux
linux 举报
2022-10-13
一、编译安装:
tar zxvf ./ss5-3.8.9-8.tar.gz
cd ss5-3.8.9
yum -y install gcc gcc-c++ automake make pam-devel openldap-devel cyrus-sasl-devel openssl-devel
./configure
make
make install
二、自启动
chmod +x /etc/init.d/ss5
chkconfig --add ss5
chkconfig --level 345 ss5 on
三、配置
vim /etc/opt/ss5/ss5.conf
 
添加auth和permit两行,启用用户验证
 
auth 0.0.0.0/0 - u
permit u 0.0.0.0/0 - 0.0.0.0/0 - - - - -
四、设置用户名密码
vim /etc/opt/ss5/ss5.passwd
 
#一行一个用户,添加如下:
 
user1 pass1
 
user2 pass2
五、设置端口
方法一:
 
vim /etc/sysconfig/ss5
 
#添加如下行
 
SS5_OPTS="-u root -b 0.0.0.0:10080"




方法二:
 
vim /etc/init.d/ss5
 
#添加如下行
 
export SS5_SOCKS_PORT=10080


export SS5_SOCKS_USER=root
6、设置防火墙
yum -y install iptables-services && systemctl start iptables && systemctl enable iptables  ##安装并启动iptables


iptables -I INPUT -p tcp --dport 10080 -j ACCEPT #添加需要开放的端口


service iptables save  #修改并保存


service iptables restart #重启防火墙


systemctl status iptables && iptables -L ##查看端口放行状态
七、测试是否搭建成功
service ss5 start && systemctl enable ss5  #启动服务


#检查服务状态


netstat -lntp | grep ss5#查看ss5运行状态


倒序看帖 只看楼主
热点关注
开源堡垒机 TELEPORT
shell脚本每行后面多了一个^M的原因和解决办法
服务停止、启动、重启一体化脚本,万能语言启动脚本
shell参数判断
在后台用进程名运行bash脚本
shell脚本每行后面多了一个^M的原因和解决办法
定时检测服务,检测down掉后重启。系统检测到DMSERVER运行正常
挂载磁盘的时候遇到一个问题,挂载完磁盘之后重启服务器挂载的盘丢失了.
中标麒麟系统Your trial is EXPIRED and no VALID licens
termux 开启ssh并用用户名和密码登陆
组成共享库的目标文件和一般的目标文件有所不同,在编译时要加-fPIC和-share选项,例如:
gcc指定链接库路径后还是找不到库文件
shell 中 if [ “x${var}“ == “x“ ] 中 x的作用
shell 脚本中常见的 if [ $? -ne 0 ]; 意思
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory