Recently a lot of netizens always ask me some QQ how to use agent things. In fact, it is very simple, through the agent hunter to find some SOCKS5 agent. Just recently learning the Linux system, and suddenly thought of using RedHat9 to do a SOCKS5 proxy server. Ok! said it was dry.
1. First in the North Skynet search SOCKS5 installation package, found a lot of the latest version is socks5-v1.0r11.tar.gz, so download to my RH9 server.
#./configure--with-threads
#make
#make Install
4. The establishment of/etc/socks5.conf, in fact, in the software package already have ready-made examples
#cd examples
#cp socks5.conf.singlehomed/etc/socks5.conf (We pick one of the simplest configuration files)
The default configuration is
# a SOCKS5 Config file for A Normal, single homed server
Permit----
This profile is allowed for anyone to use this SOCKS5 agent and does not need to be validated
If you want to restrict access to only one IP segment (192.168.0.0/255.255.255.0), you can change it to
Permit--192.168.0. - - -
or allow only one IP (192.168.0.10) access to use, can be changed to
Permit--192.168.0.10--
5.ok Run socks5-t start SOCKS5 Service, and then use QQ to test whether the agent is effective, remember the default port is 1080
Anyway, I was in the FTP software and QQ on the test is no problem.
6. If you want to stop socks5, as long as the running Stopsocks-kill on the line, SOCKS5 will stop!
7. Use Non-default ports: If you want the SOCKS5 service to start without starting the default listening port 1080, for example, 1234, we can run the following command
Socks5-b 1234-t Of course, if you turn off this service, you must use the following command Stopsocks-p 1234-kill
8. Let's drill down to socks5.conf to make SOCKS5 use the user authentication mechanism
To use user authentication, you first create a/etc/socks5.pwsswd file
The content is: (UserA represents the user name.) Passwda on behalf of the user UserA password)
#/etc/socks5.passwd
UserA Passwda
UserB passwdb
UserC PASSWDC
Then modify the/etc/socks5.conf
Add the following statement
Auth--U
or put:
Auth--Change into auth--u
Add to:
Change the default permit----to permit u-192.168.0. - - -
That allows any user-authenticated connection from the 192.168.0.0/255.255.255.0 network segment
If you do not want the password file to exist in the default/etc/socks5.passwd. Want to have custom files, such as/etc/qq.passwd
Then you have to revise the/etc/socks5.conf. Add a parameter
Set SOCKS5_PWDFILE/ETC/QQ.PASSWD
Ok! Restart the service, if you do not enter the correct username and password is not used SOCKS5 proxy server, enter the correct username and password can be used.
The above argument, we can use together, such as restricting the use of an IP segment SOCKS5 service, and to use user name authentication
In addition, there are some parameters for/etc/socks5.conf, we will study it by ourselves
Set SOCKS5_BINDINFC 192.168.0.8:1080
Ignores ident requests. Using socks5_noident reduces the timeout value when the client computer is not running Identd
Set Socks5_noident
Specifies the maximum length of time the connection pauses. SOCKS5 Disconnect after maximum value is exceeded
Set Socks5_timeout 15
SOCKS5 will accept the request of the Socks V4 protocol, default does not accept
Set Socks5_v4support
Specifies the maximum number of Socks5 that exist simultaneously, with a preset of 64
Set Socks5_maxchild 4
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.