1.配置编译环境
yum -y install gcc automake make
2.安装socks5必要的包
yum -y install pam-devel openldap-devel cyrus-sasl-devel
3.下载,编译安装ss5(socks5)
wget http://jaist.dl.sourceforge.net/sourceforge/ss5/ss5-3.6.1-1.tar.gz
tar zxvf ss5-3.6.1-1.tar.gz
cd ss5-3.6.1
./configure
make
make install
#启动ss5服务
/etc/init.d/ss5 start
添加ss5到服务中,并随机启动
chkconfig --add ss5
chkconfig ss5 on
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
在 /etc/opt/ss5/ss5.passwd 中添加 用户名和密码 如:
test test
使用用户验证,重启ss5服务
/etc/init.d/ss5 restart
_____________________________________________________________
下面运行代码,没复制全,差不多吧
SS5Mod_socks4.c:705: warning: cast to pointer from integer of different size
gcc -g -O2 -DLINUX -I . -I ../../include -shared -fPIC -c -o SS5OpenLdap.o S S5OpenLdap.c
SS5OpenLdap.c: In function \'DirectoryQuery\':
SS5OpenLdap.c:163: warning: assignment makes pointer from integer without a cast
SS5OpenLdap.c:165: warning: cast to pointer from integer of different size
gcc -g -O2 -DLINUX -I . -I ../../include -shared -fPIC -o mod_socks4.so SS5Mod _socks4.o SS5OpenLdap.o -lpthread
make[2]: Leaving directory `/root/ss5-3.6.1/modules/mod_socks4\'
make[2]: Entering directory `/root/ss5-3.6.1/modules/mod_socks5\'
gcc -g -O2 -DLINUX -I . -I ../../include -shared -fPIC -c -o SS5Mod_socks5.o SS5Mod_socks5.c
SS5Mod_socks5.c: In function \'MethodParsing\':
SS5Mod_socks5.c:68: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:114: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:122: warning: cast to pointer from integer of different size
SS5Mod_socks5.c: In function \'RequestParsing\':
SS5Mod_socks5.c:151: warning: cast to pointer from integer of different size
SS5Mod_socks5.c: In function \'UpstreamServing\':
SS5Mod_socks5.c:228: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:245: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:262: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:266: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:273: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:281: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:295: warning: cast to pointer from integer of different size
SS5Mod_socks5.c: In function \'ConnectServing\':
SS5Mod_socks5.c:350: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:367: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:381: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:425: warning: cast to pointer from integer of different size
SS5Mod_socks5.c: In function \'BindServing\':
SS5Mod_socks5.c:495: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:503: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:529: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:543: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:579: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:605: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:631: warning: cast to pointer from integer of different size
SS5Mod_socks5.c: In function \'UdpAssociateServing\':
SS5Mod_socks5.c:706: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:734: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:772: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:780: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:807: warning: cast to pointer from integer of different size
SS5Mod_socks5.c:914: warning: cast to pointer from integer of different size
SS5Mod_socks5.c: In function \'UdpAssociateResponse\':
SS5Mod_socks5.c:992: warning: cast to pointer from integer of different size
SS5Mod_socks5.c: In function \'FileCheck\':
SS5Mod_socks5.c:1191: warning: cast to pointer from integer of different size
gcc -g -O2 -DLINUX -I . -I ../../include -shared -fPIC -c -o SS5OpenLdap.o S S5OpenLdap.c
SS5OpenLdap.c: In function \'DirectoryQuery\':
SS5OpenLdap.c:163: warning: assignment makes pointer from integer without a cast
SS5OpenLdap.c:165: warning: cast to pointer from integer of different size
gcc -g -O2 -DLINUX -I . -I ../../include -shared -fPIC -o mod_socks5.so SS5Mod _socks5.o SS5OpenLdap.o -lpthread
make[2]: Leaving directory `/root/ss5-3.6.1/modules/mod_socks5\'
make[2]: Entering directory `/root/ss5-3.6.1/modules/mod_authen\'
gcc -g -O2 -DLINUX -I . -I ../../include -shared -fPIC -c -o SS5Mod_authenti cation.o SS5Mod_authentication.c
SS5Mod_authentication.c: In function \'Authentication\':
SS5Mod_authentication.c:68: warning: cast to pointer from integer of different s ize
SS5Mod_authentication.c:153: warning: cast to pointer from integer of different size
SS5Mod_authentication.c:163: warning: cast to pointer from integer of different size
SS5Mod_authentication.c:182: warning: cast to pointer from integer of different size
gcc -g -O2 -DLINUX -I . -I ../../include -shared -fPIC -c -o SS5Basic.o SS5B asic.c
SS5Basic.c: In function \'S5PwdFileOpen\':
SS5Basic.c:30: warning: cast to pointer from integer of different size
SS5Basic.c: In function \'S5PwdFileClose\':
SS5Basic.c:59: warning: cast to pointer from integer of different size
gcc -g -O2 -DLINUX -I . -I ../../include -shared -fPIC -c -o SS5ExternalProg ram.o SS5ExternalProgram.c