server_2_multiple_server.example
资源名称:socks5.zip [点击查看]
上传用户:sddyfurun
上传日期:2007-01-04
资源大小:525k
文件大小:6k
源码类别:
代理服务器
开发平台:
Unix_Linux
- File Name: server_2_multiple_server.example
- 1.Example - socks5 Username/Password server to multiple Kerberos servers
- authentication
- # This example describes a socks5 environment with:
- # - three single-homed servers S5SV1, S5SV2, and S5SV3 on network 163.201.56
- # with one client, CL1 and destination dest1
- #
- # S5SV1 and CL1 use Username/Password authentication
- # S5SV2 and S5SV3 use Kerberos and support Username/Password authentication
- #
- # S5SV1 has one socks5 user user1
- # CL1 has one socks5 user user4
- #
- # S5SV2 uses Kerberos id S5SV2.ker.id
- # S5SV3 uses Kerberos id S5SV3.ker.id
- #
- # CL1 has one socks5 user, user4, who can issue all commands to any destination
- # using any port on network 163.201.56. using server S5SV1:3000.
- #
- # When S5SV1:3000 receives a request for destination Dest1, whose IP address
- # is 163.201.56.5 on any port, S5SV1 sends the request to proxy server S5SV2
- #
- # When S5SV1 receives a request for any other destination on 163.201.56, S5SV1
- # sends the request to proxy server S5SV3. If S5SV3 is not available, S5SV1
- # sends the request to S5SV2. If S5SV2 is not available, the command fails.
- Kerberos
- --------
- ____________ | S5SV2 |___________
- | -------- |
- | |
- ------- -------- ---------
- | CL1 |---- | S5SV1 | 163.201.56 | Dest1 |
- ------- -------- ---------
- Username/Password |
- IP 163.201.56.1 -------- |
- |_____________ | S5SV3 |__________|
- --------
- Kerberos
- 2. Server Environment Variables
- # You must tell the server where to find the configuration file. You can do so
- # in one of three ways:
- # - Set the environment variable SOCKS5_CONFFILE
- # - Include the socks5.conf file in the default directory, usually /etc
- # - Build with the --with-srvconffile=path option
- # This example demonstrates using environment variables. The example path is
- # arbitrary.
- # Set the environment variables for S5SV1, S5SV2 and S5SV3.
- # S5SV1:3000
- setenv SOCKS5_CONFFILE /socksdir/run/socks5.conf.3000
- setenv SOCKS5_PWDFILE /socksdir/run/socks5.passwd
- setenv SOCKS5_USER user1
- setenv SOCKS5_PASSWD pass1
- setenv SOCKS5_NONETMASKCHECK
- # S5SV2:2000
- setenv SOCKS5_CONFFILE /socksdir/run/socks5.conf.2000
- setenv SOCKS5_PWDFILE /socksdir/run/socks5.passwd
- setenv SOCKS5_USER user2
- setenv SOCKS5_PASSWD pass2
- setenv SOCKS5_NONETMASKCHECK
- # S5SV3:3050
- setenv SOCKS5_CONFFILE /socksdir/run/socks5.conf.3050
- setenv SOCKS5_PWDFILE /socksdir/run/socks5.passwd
- setenv SOCKS5_USER user3
- setenv SOCKS5_PASSWD pass3
- setenv SOCKS5_NONETMASKCHECK
- 3. Server Configuration File socks5.conf
- # These are the socks5.conf files for S5SV1 with Username/Password
- # authentication, S5SV2 and S5SV3 with Kerberos and Username/Password
- # authentication.
- #
- # The socks5.conf files must be in the directories specified in the
- # SOCKS5_CONFFILE environment variable or the default directory, usually /etc
- # S5SV1:3000 filename /socksdir/run/socks5.conf.3000
- auth 163.201. - u
- permit u - 163.201. 163.201. - - user1,user2,user3,user4
- socks5 Dest1 - S5SV2:2000
- socks5 163.201.56. - S5SV3:3050,S5SV2:2000
- #S5SV2:2000 filename /socksdir/run/socks5.conf.2000
- auth 163.201. - u,k
- permit u,k - 163.201. 163.201. - - user1,user2,user3,user2.ker.id, /
- user3.ker.id,user4
- #S5SV3:3050 filename /socksdir/run/socks5.conf.3050
- auth 163.201. - u,k
- permit u,k - 163.201. 163.201. - - user1,user2,user3,user2.ker.id, /
- user3.ker.id,user4
- 4. Server socks5 Password File
- # This is the socks5 Username/Password file. It should be in the directory
- # specified in the SOCKS5_PWDFILE environment variable, or the default
- # directory, usually /etc
- # This file should reside on all three servers or be accessible to all three
- # servers.
- # To add more users, place each user on a new line with username and password
- # separated by white space.
- user1 pass1
- user2 pass2
- user3 pass3
- user4 pass4
- 5. Runtime mode
- # To start the socks5 daemons in standalone mode on S5SV1 on bindport 3000,
- # S5SV1:3000, at the command prompt, type:
- # ./socks5 -b 3000
- # To start the socks5 daemons in standalone mode on S5SV2 on bindport 2000,
- # S5SV2:2000, at the command prompt, type:
- # ./socks5 -b 2000
- # To start the socks5 daemons in standalone mode on S5SV3 on bindport 3050
- # S5SV3:3050, at the command prompt, type:
- # ./socks5 -b 3050
- 6. Client Configuration File libsocks5.conf
- # This is the libsocks5.conf configuration file for clientA. It must be in the
- # directory specified in the build, or in the default directory, usually /etc.
- socks5 - 163.201.64. - sam 163.201.56.1:3000 #sam is the unix userid
- 7. Client Environment Variables
- # In this example, because the client and the server are on the same network,
- # it is most efficient to run the socks5 client without a libsocks5.conf file.
- # The client connects directly to the server. To directly connect:
- # - do not set the SOCKS5_NONETMASKCHECK environment variable
- # - set the SOCKS5_SERVER S5SV1:3000 or include the build option
- # --with-default-server=S5SV1:3000. See the configure man page for
- # additional information about this build option.
- # Environment variables with a libsocks5.conf file
- setenv SOCKS5_NONETMASKCHECK
- setenv SOCKS5_USER user2
- setenv SOCKS5_PASSWD pass2