Install ss5 on CentOS7 to implement SOCKS5 proxy service
References related to this article
ss5 official document Socks5 uses SSL Socks5's secure user name and password authorization protocolExecute the following commands in sequence to install EPEL, compilation tools and necessary dependencies.
yum install epel-release -y
yum groupinstall 'Development Tools' -y
yum install gcc automake autoconf libtool make yum-utils wget -y
yum install pam-devel openldap-devel openssl-devel -y
Download the source code, compile and install
The download address may be invalid. If you encounter a download failure, you can search again on Google.It is recommended to keep a copy of the source code after successful download, so that it can be used in future reinstallation.
cd /usr/local/src/
wget https://jaist.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz
tar xzf ss5-3.8.9-8.tar.gz
cd ss5-3.8.9
./configure
./make
./make install
Modify the configuration file, select the authorization method when connecting and configure the account and password
Use vim or vi to modify the ss5.conf file and remove the "#" of "#auth". The purpose of this modification is to enable connection authorization verification, otherwise you can connect anonymously when connecting.Then remove the "#" of "#permit" and change the authorization from "–" to "u". The purpose of this modification is to use the username and password for authentication.We will also need to configure the account password for login later.The modification of this part can refer to the following example.
vim /etc/opt/ss5/ss5.conf
# SHost SPort Authentication
auth 0.0.0.0/0 - u
# Auth SHost SPort DHost DPort Fixup Group Band ExpDate
permit u 0.0.0.0/0 - 0.0.0.0/0 - - - - -
Use vim or vi to edit the ss5.passwd file. Each line of this file represents an account.The format of an account contains two parts: account number and password. You must enter the account number first and then enter the password. The account number and password must be separated by spaces. The account number and password themselves cannot contain spaces.The following is a reference example of establishing two accounts.
user1 password1
user2 password2
Start proxy service
After the above configuration, we can start the proxy service.After starting the service with the following command, we can check the status of port 1080 to determine whether the service is running normally.We also need to check whether the bound IP address is the IP we need. If we need to modify the bound IP address or port, we can modify the configuration file again, and then restart the proxy service to make our changes take effect.
/usr/sbin/ss5 -t