首页 > Linux系统管理 > sock5 安装配置
2015
07-31

sock5 安装配置

最近公司有些人需要访问Facebook,就打算在美国的机器上面整个sock代理给他们用

首先到http://ss5.sourceforge.net/去下载最新的版本
cd ss5-3.8.9
./configure
checking for security/pam_misc.h... no
configure: error: *** Some of the headers weren't found ***
 yum -y install pam-devel
再configure 没报错
make
SS5OpenLdap.c:29:18: error: ldap.h: No such file or directory
SS5OpenLdap.c: In function ‘DirectoryQuery’:
SS5OpenLdap.c:131: error: ‘LDAP’ undeclared (first use in this function)
SS5OpenLdap.c:131: error: (Each undeclared identifier is reported only once
SS5OpenLdap.c:131: error: for each function it appears in.)
SS5OpenLdap.c:131: error: ‘ld’ undeclared (first use in this function)
SS5OpenLdap.c:133: error: ‘LDAPMessage’ undeclared (first use in this function)
SS5OpenLdap.c:133: error: ‘result’ undeclared (first use in this function)
SS5OpenLdap.c:136: error: ‘LDAP_VERSION3’ undeclared (first use in this function)
SS5OpenLdap.c:190: error: ‘LDAP_SUCCESS’ undeclared (first use in this function)
SS5OpenLdap.c:197: error: ‘LDAP_OPT_PROTOCOL_VERSION’ undeclared (first use in this function)
SS5OpenLdap.c:198: error: ‘LDAP_OPT_REFERRALS’ undeclared (first use in this function)
SS5OpenLdap.c:198: error: ‘LDAP_OPT_OFF’ undeclared (first use in this function)
SS5OpenLdap.c:202: error: ‘LDAP_AUTH_SIMPLE’ undeclared (first use in this function)
SS5OpenLdap.c:211: error: ‘LDAP_SCOPE_SUBTREE’ undeclared (first use in this function)
make[1]: *** [SS5OpenLdap.o] Error 1
make[1]: Leaving directory `/root/ss5-3.8.9/common'
make: *** [common] Error 2
yum -y install openldap-devel
make 继续有报错
In file included from SS5Radius.c:22:
../include/SS5Radius.h:22:25: error: openssl/md5.h: No such file or directory
SS5Radius.c: In function ‘S5RadiusAuth’:
SS5Radius.c:43: error: ‘MD5_CTX’ undeclared (first use in this function)
SS5Radius.c:43: error: (Each undeclared identifier is reported only once
SS5Radius.c:43: error: for each function it appears in.)
SS5Radius.c:43: error: expected ‘;’ before ‘md5’
SS5Radius.c:45: error: ‘MD5_DIGEST_LENGTH’ undeclared (first use in this function)
SS5Radius.c:86: error: ‘md5’ undeclared (first use in this function)
SS5Radius.c: In function ‘S5RadiusAcct’:
SS5Radius.c:359: error: ‘MD5_CTX’ undeclared (first use in this function)
SS5Radius.c:359: error: expected ‘;’ before ‘md5’
SS5Radius.c:361: error: ‘MD5_DIGEST_LENGTH’ undeclared (first use in this function)
SS5Radius.c:476: error: ‘md5’ undeclared (first use in this function)
make[1]: *** [SS5Radius.o] Error 1
make[1]: Leaving directory `/root/ss5-3.8.9/common'
make: *** [common] Error 2
yum -y install openssl-devel
再make 就没报错了
总结下来就是安装socks需要安装 pam-devel openldap-devel cyrus-sasl-devel openssl-devel 这些包
make install

记得 chmod +x /etc/init.d/ss5
默认安装好没有加权限的

二、修改配置文件
1、修改/etc/opt/ss5/ss5.conf
auth 0.0.0.0/0 – u
permit u 0.0.0.0/0 – 0.0.0.0/0 – – – – –
2、在/etc/rc.d/init.d/ss5 文件修改自定义端口,默认为1080
daemon /usr/sbin/ss5 -t $SS5_OPTS -b 0.0.0.0:10888
3、在/etc/sysconfig/ss5 中,取消注释。
SS5_OPTS=” -u root”
4、添加验证用户及密码,由于密码是明文的,注意控制权限。
# cat ss5.passwd #一行一个用户+密码
test 123
lxsym 123
# chmod 700 /etc/rc.d/init.d/ss5
# chmod/etc/rc.d/init.d/ss5
[root@lx_web_s1 ss5-3.8.9]# /etc/rc.d/init.d/ss5 restart
Restarting ss5… Shutting down ss5…
done [ OK ]
doneting ss5… [ OK ]
服务端安装成功,现在就可以使用服务器的IP, 端口10888, 用户test, 密码123来测试你的socks5服务器了。
最后加入开机自动启动
chkconfig –add ss5
chkconfig –level 345 ss5 on
比如代理上QQ,当ssh跳板机,后面会介绍。它还有很多用途~~

 

sock5 安装配置 - 第1张  | 大话运维

最后编辑:
作者:saunix
大型互联网公司linux系统运维攻城狮,专门担当消防员

留下一个回复