Install Socks5 Proxy in Linux
Install Socks5 Proxy in Linux
1. Environment
Linux, gcc, yum.
2. Install Socks5.
Download http://sourceforge.net/projects/ss5/files/
ss5-3.8.9-8.tar.gz
# gunzip ss5-3.8.9-8.tar.gz
# tar xvf ss5-3.8.9-8.tar
Download some related pacakges:
#yum -y install pam-devel openssl-devel openldap-devel
3. Build
# ./configure
Compile.
# make
# make install
4. Configure
4.1 Modify /etc/opt/ss5/ss5.conf
No authentication
auth 0.0.0.0/0 - -
User authentication
auth 0.0.0.0/0 - u
permit u 0.0.0.0/0 - 0.0.0.0/0 - - - - -
4.2 Uncomment following line in /etc/sysconfig/ss5
SS5_OPTS=” -u root”
4.3 Modify port, defuat 1080
Modify /etc/rc.d/init.d/ss5
daemon /usr/sbin/ss5 -t $SS5_OPTS -b 0.0.0.0:10888
4.4 Add user and password.
Modify /etc/opt/ss5/ss5.passwd
# cat ss5.passwd
test 123
test2 123
4.5 Add auto-start
# chkconfig --add ss5
# chkconfig --level 345 ss5 on
4.6 Change ss5 executable
# chmod 700 /etc/rc.d/init.d/ss5
4.7 Set log file for ss5
When get error: Starting ss5... [ERRO] Error opening log file$
# export SS5_LOG_FILE=/var/log/ss5.log
This line can be added in script /etc/rc.d/init.d/ss5
4.8 Restart service
# /etc/rc.d/init.d/ss5 restart
5. Verify
Use QQ to verify the service.
6. Package compiled binary
Copy following files and put them into a tar file.
/etc/opt/ss5/
/etc/opt/ss5/ss5.passwd
/etc/opt/ss5/ss5.conf
/etc/opt/ss5/ss5.ha
/etc/rc.d/init.d/ss5
/etc/sysconfig/ss5
/usr/lib/ss5/
/usr/lib/ss5/mod_proxy.so
/usr/lib/ss5/mod_authentication.so
/usr/lib/ss5/mod_filter.so
/usr/lib/ss5/mod_socks5.so
/usr/lib/ss5/mod_log.so
/usr/lib/ss5/mod_statistics.so
/usr/lib/ss5/balamgr.cgi
/usr/lib/ss5/statmgr.cgi
/usr/lib/ss5/mod_authorization.so
/usr/lib/ss5/mod_balance.so
/usr/lib/ss5/mod_bandwidth.so
/usr/lib/ss5/SS5Logo.jpg
/usr/lib/ss5/mod_socks4.so
/usr/lib/ss5/mod_dump.so
/usr/sbin/ss5
/var/run/ss5
Labels: SOCKS5 Linux proxy