Debug the SOCKS5 server
Recently, many netizens have been asking me how to use agents on QQ. In fact, it is very easy to find some SOCKS5 agents through the Agent Hunter. Just recently I was studying Linux, So I suddenly thought of using rh9 as a SOCKS5 proxy server. OK! Just do what you say
1. First, search for the installation package of socks5on Peking University Skynet and find the latest version is socks5-v1.0r11.tar.gz. Then download it to my rh9 server.
2. Decompress the package
# Tar xvfz socks5-v1.0r11.tar.gz
3. Start Compilation
# Cd socks5-v1.0r11
#./Configure -- With-threads
# Make
# Make install
4. Create/etc/socks5.conf. In fact, there is a ready-made examples in the software package.
# Cd examples
# Cp socks5.conf. singlehomed/etc/socks5.conf (select the simplest configuration file)
The default configuration is
# A SOCKS5 config file for a normal, single homed Server
Permit ------
This configuration file allows anyone to use this SOCKS5 proxy without verification.
If you want to restrict access to a specific IP segment (192.168.0.0/255.255.255.0), you can change it
Permit--192.168.0 .---
Or only one IP address (192.168.0.10) can be accessed and used.
Permit--192.168.0.10 ---
5. Run SOCKS5-t to start the SOCKS5 service, and then use QQ to test whether the agent is effective. Remember that the default port is 1080.
I tried it on FTP and QQ.
6. To stop SOCKS5, just run stopsocks-kill and SOCKS5 will stop!
7. Use non-default port: If you want to disable the default listening port 1080 when the SOCKS5 service is started, for example, 1234, run the following command:
SOCKS5-B 1234-T. Of course, if you disable this service, you must use the following command stopsocks-P 1234-kill.
8. Configure socks5.conf in depth to enable SOCKS5 to use the user authentication mechanism.
To use user authentication, you must first create the/etc/socks5.pwsswd File
The content is: (usera represents the user name. Passwda indicates the usera password)
#/Etc/socks5.passwd
Usera passwda
Userb passwdb
Userc passwdc
Then modify/etc/socks5.conf
Add the following statements
Auth-u
Or:
Auth---changed to auth--u
Add:
Change the default permit---to permit U-192.168.0 .---
Allow any user-authenticated connection from the 192.168.0.0/255.255.255.0 network segment
If you do not want to store the password file in the default/etc/socks5.passwd. To create a custom file, such as/etc/QQ. passwd
Modify/etc/socks5.conf to add a parameter.
Set socks5_pwdfile/etc/QQ. passwd
OK! Restart the service. If you do not enter the correct user name and password, you cannot use the SOCKS5 Proxy Server. Enter the correct user name and password.
The preceding parameters can be used in combination. For example, you can restrict an IP segment to use the SOCKS5 service and use the user name for verification.
In addition, there are some parameters for/etc/socks5.conf. Let's study them by yourself.
Set socks5_bindinfc 192.168.0.8: 1080
Ignore ident requests. When the client does not run identd, socks5_noident will reduce the timeout value.
Set socks5_noident
Specifies the maximum pause time of a connection. When the maximum value is exceeded, SOCKS5 is disconnected.
Set socks5_timeout 15
SOCKS5 will accept socks V4 Protocol requests, which are not accepted by default
Set socks5_v4support
Specifies the maximum number of sub-processes simultaneously. The default value of SOCKS5 is 64.
Set socks5_maxchild 4