CentOS 5 安装配置 Socks5 服务

时间: 2011-12-29 / 分类: 人生随想 / 浏览次数: 146 views / 0个评论 发表评论

1. 配置 Socks5 编译环境

1
2
yum -y install gcc automake autoconf libtool make
yum -y install gcc gcc-c++ bison patch unzip mlocate flex wget automake autoconf gd cpp gettext readline-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel libidn libidn-devel openldap openldap-devel openldap-clients openldap-servers nss_ldap expat-devel libtool libtool-ltdl-devel krb5 krb5-devel libmcrypt libmcrypt-devel mhash mhash-devel mcrypt mcrypt-devel curl curl-devel openssl-devel

2. 安装 Socks5 必要的包

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

3.下载,编译安装 Socks5
到此下载 http://sourceforge.net/projects/ss5/files/

http://ss5.sourceforge.net/

官方实例

http://ss5.sourceforge.net/examples.htm

1
2
3
4
5
6
wget -c http://downloads.sourceforge.net/project/ss5/ss5/3.6.4-3/ss5-3.6.4-3.tar.gz
tar zxvf ss5-3.6.4-3.tar.gz
cd ss5-3.6.4
./configure
make
make install

4. 启动ss5服务并开机启动

1
2
3
/etc/init.d/ss5 start
chkconfig --add ss5
chkconfig ss5 on

5. 重名Socks V4模块

1
mv /usr/lib/ss5/mod_socks4.so /usr/lib/ss5/mod_socks4.so.bk

6.添加 SS5 用户
ss5 默认使用1080端口,并允许任何人使用。
我们可以修改 /etc/opt/ss5/ss5.conf 中的

1
2
3
4
5
6
7
8
#       SHost           SPort           Authentication
#
auth    0.0.0.0/0               -              -
为
<pre line="1" colla="+">
#       SHost           SPort           Authentication
#
auth    0.0.0.0/0               -              u

在 /etc/opt/ss5/ss5.passwd 中添加 用户名和密码 如:

1
test test

7. 使用用户验证,重启ss5服务

1
/etc/init.d/ss5 restart

8.修改启动文件,改日志不保存
在ss5启动时添加一个-m的参数,这个参数使系统不再记录ss5的日志。
改ss5端口,格式为-b ip地址:端口

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
vi /etc/rc.d/init.d/ss5
 
start)
        # Start daemon.
 
        echo -n "Starting ss5... "
        if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then
        /usr/sbin/ss5 -m -t -b 91.207.192.35:2080
        touch /var/lock/subsys/ss5
        else
                /usr/local/sbin/ss5 -m -t -b 91.207.192.35:2080
        fi
        echo "done"

发表评论

您的昵称 *

您的邮箱 *

您的网站