How to install sock proxy

We can install Sock proxy by using below step in Centos
SS5 is a high-performance SOCKS proxy server implementing SOCK4 and SOCKS5 protocols. Below is the step for the installation and configuration of SS5 with user/password authentication on a CentOS 5.x/6.x server.

Step 1) Download the latest source rpm from sourceforge.net

# cd /
# wget http://downloads.sourceforge.net/ss5/ss5-3.8.9-8.src.rpm
run the above command under /. It will download the package for Socks proxy.

Step 2) Build the source rpm

Install below packages using the YUM package manager.
For 32 bit Linux,
# yum install gcc rpm-build openldap-devel pam-devel openssl-devel
For 64 bit Linux,
# yum install gcc.x86_64 rpm-build.x86_64 openldap-devel.x86_64 pam-devel.x86_64 openssl-devel.x86_64

Install libgssapi-devel,
# yum install libgssapi-devel

Now build ss5 source rpm to create the binary rpm package
# rpmbuild –rebuild ss5-3.8.9-8.src.rpm

Step 3) Install SS5 rpm package

# cd /
# rpm -ivh rpmbuild/RPMS/x86_64/ss5-3.8.9-8.x86_64.rpm (for 64 bit Linux)
# rpm -ivh rpmbuild/RPMS/x86_64/ss5-3.8.9-8.i386.rpm (for 32 bit Linux)

Step 4) Run SS5 as root and change the port to 8899 (default port is 1080)

Edit vi /etc/init.d/ss5 and put following lines at the top after shabang(#!/bin/sh):
export SS5_SOCKS_PORT=8899
export SS5_SOCKS_USER=root

You can use any available port you want. Make sure that the port is opened in the buy proxy server.

Step 5) User/password authentication

SS5 configuration file is vi /etc/opt/ss5/ss5.conf. The ‘auth’ directive sets the authentication policy.

For no authentication,
auth 0.0.0.0/0 – –
For user/pass authentication,
auth 0.0.0.0/0 – u

The user/password pairs are stored in vi /etc/opt/ss5/ss5.passwd. Setup permission:
# chown root:root /etc/opt/ss5/ss5.passwd
# chmod 755 /etc/opt/ss5/ss5.passwd
# chmod 755 /etc/opt/ss5

In vi /etc/opt/ss5/ss5.passwd, put user and password separated by a space and one user/password per line.
E.g.
user1 pass1
user2 pass2

Set permission ( /etc/opt/ss5/ss5.conf )
Allow all hosts to connect:
permit u 0.0.0.0/0 – 0.0.0.0/0 – – – – –

Step 6) Start/Stop/Restart ss5

service ss5 start
service ss5 stop
service ss5 restart

Leave a comment