CENTOS 下安装配置 SOCKS5

1.安装编译环境

yum -y install gcc automake make

2.安装ss5必要的包

yum -y install pam-devel openldap-devel cyrus-sasl-devel openssl-devel

3.下载并安装ss5

wget http://sourceforge.net/projects/ss5/files/latest/download?source=files
tar zxvf ss5-*
cd ss5-*
./configure
make
make install

#更改ss5权限,使其可执行
chmod 700 /etc/init.d/ss5
#启动ss5服务
/etc/init.d/ss5 start

4.配置ss5,允许指定用户可以使用

ss5 默认情况下使用1080 端口,并且允许任何人使用。如果想要指定某个人才可以使用的话,则需要修改 /etc/opt/ss5/ss5.conf 中的

#       SHost           SPort           Authentication
#
auth    0.0.0.0/0               -              -

#修改为:

#       SHost           SPort           Authentication
#
auth    0.0.0.0/0               - u
#      Auth     SHost           SPort   DHost           DPort   Fixup   Group   Band    ExpDate
#
#permit -       0.0.0.0/0       -       0.0.0.0/0       -       -       -       -       -

修改为:

#      Auth     SHost           SPort   DHost           DPort   Fixup   Group   Band    ExpDate
#
permit u 0.0.0.0/0       -       0.0.0.0/0       -       -       -       -       -

5.添加ss5用户

最后需要在 /etc/opt/ss5/ss5.passwd 中添加连接 socks 5 时使用的 用户名和密码 如:

test passwd

6.重启ss5服务

/etc/init.d/ss5 restart
#或者
service ss5 restart

7.设置开机启动

#设置开机启动
chkconfig ss5 on

8.修改默认端口

vi /etc/sysconfig/ss5
之前为:
#SS5_OPTS=" -u root"
修改为:
SS5_OPTS=" -u root -b 0.0.0.0:希望的端口"

发表评论