socks5.conf.5
资源名称:socks5.zip [点击查看]
上传用户:sddyfurun
上传日期:2007-01-04
资源大小:525k
文件大小:14k
源码类别:
代理服务器
开发平台:
Unix_Linux
- .TH socks5.conf 5 "02 May 1997"
- .SH NAME
- socks5.conf - Configuration file for the socks5 daemon
- .SH SYNOPSIS
- The socks5 daemon usually reads the configuration file in /etc/socks5.conf. When you configure and build socks5 with the
- .PP
- .RS 5
- --with-srvconffile=fIfilenamefP
- .RE
- .PP
- option, you can change the directory. Under FreeBSD's UNIX port, the configuration file resides in /usr/local/etc/socks5.conf.
- .SH DESCRIPTION
- The socks5 daemon reads the configuration file when it starts and each time it receives an HUP signal. The configuration file contains the information the server needs to determine:
- .RS 5
- - the interface to use to reach an address
- .br
- - when the server should connect directly to an address
- .br
- - when the server should use another proxy server
- .br
- - the necessary requirements to make a proxy connection
- .RE
- .PP
- The configuration file contains six sections:
- .RS 5
- - ban host
- .br
- - authentication
- .br
- - interfaces
- .br
- - variables and flags
- .br
- - proxies
- .br
- - access control
- .RE
- .PP
- In each section, the socks5 daemon sequentially reads each line until it encounters a matching line for that section. The order of sections and the order of lines within a section are crucial to achieving the desired result. Every entry in a line must match.
- .SH BAN HOST ENTRIES
- Ban host entries identify hosts from which the socks5 daemon should not accept connections and use the syntax:
- .PP
- .RS 5
- ban fIsource-host source-portfP
- .RE
- .TP 15
- .B ban
- Indicates not to attempt authentication
- .TP
- .B fIsource-hostfP
- Must be a valid fIhostpatternfP
- .TP
- fIsource-portfP
- Must be a valid fIportpatternfP
- .PP
- The socks5 daemon refuses connections originating from clients on fIsource-portfP at fIsource-hostfP.
- .SH AUTHENTICATION ENTRIES
- Authentication entries identify the types of authentication the socks5 daemon can use. Authentication lines use the syntax:
- .PP
- .RS 5
- auth fIsource-host source-port auth-methodsfP
- .RE
- .TP 15
- .B auth
- Identifies the entry as an authentication entry
- .TP
- .B fIsource-hostfP
- Must be a valid fIhostpatternfP
- .TP
- fIsource-portfP
- Must be a valid fIportpatternfP
- .TP
- .B fIauth-methodsfP
- Must be a valid fIauthpatternfP
- .PP
- The socks5 daemon authenicates clients that originate on fIsource-portfP at fIsource-hostfP using fIauth-methodsfP.
- .PP
- When the configuration file does not contain fB authfP lines, any authentication works. Omitting auth lines is the same as specifying an fIauthpatternfP containing -, any authentication. If fBauthfP lines are used, clients not matching will be refused.
- .PP
- When the socks5 daemon does not require authentication, it receives no user information unless socks5 configuration requires ident responses. Use the SOCKS5_DEMAND_IDENT environment variable to require ident responses. See socks5(1) for a complete description of socks5 environment variables.
- To ensure that the socks5 daemon receives usernames from the client, and to allow socks4 clients to use the server, set the fIauthpatternfP order to n,u. With socks5 clients, the socks daemon chooses Username/Password authentication before no authentication.
- .PP
- The socks5 daemon checks fIauth-methodsfP in reverse order, beginning with the last fIauth-methodfP in fIauthpatternfP.
- .PP
- .SH INTERFACE ENTRIES
- On machines with multiple interfaces, and therefore multiple IP addresses, frequently administrators want to ensure that socks5 uses certain interfaces with certain addresses. This prevents outside machines from impersonating inside machines by requiring inside machines to use the inside interface and outside machines to use the outside interface. It also allows socks5 to determine on which interface to bind when accepting a bind request, or when issuing a sendto request.
- .PP
- When socks5 fails to find a match in the configuration file, it uses INADDR_ANY to bind, and receives a connection on any interface.
- .PP
- Single-homed hosts do not require interface entries. Only machines with more than one interface should use interface entries.
- .PP
- Use this format for interface entries in the socks5.conf file:
- .RS 5
- .TP
- interface fIhostpattern portpattern interface-addressfP
- .RE
- .TP 18
- .B interface
- Identifies interface entries
- .TP
- fIhostpatternfP
- Contains a source or destination host for a connection
- .TP
- fIportpatternfP
- Contains a source or destination port for a connection
- patternfP
- .TP
- .B fIinterface-addressfP
- Identifies the IP address of an interface card or the name of the interface, for example le0.
- .PP
- When fIhostpatternfP or fIportpatternfP specify a source address, the patterns define the fIinterface-addressfP clients must use to connect to the socks5 server when connecting from the host defined in fIhostpatternfP or the port defined in fIportpatternfP. Connection attempts from interface addresses other than fIinterface-addressfP fail.
- When fIhostpatternfP or fIportpatternfP specify a destination address, the patterns define the interface address the socks5 daemon uses to connect to the host defined in fIhostpatternfP or the port defined in fIportpatternfP.
- The fIinterfacefP entry replaces the fIroutefP entry of previous releases. For the current release, the entries are equivalent. In future releases, support for fIroutefP entries may be removed.
- .pp
- .PP
- .SH VARIABLE ENTRIES
- Variables and flags in the configuration file control the amount and types of logging and information messages. The configuration file syntax for initializing variables is:
- .RS 5
- .TP
- set fIvariablefP fIvaluefP
- .RE
- .PP
- .TP 10
- set
- Identifies entries that initialize environment variables for internal use.
- .P
- Refer to the socks5(1) ENVIRONMENT section for complete details about socks5 environment variables and values.
- .PP
- .SH PROXY ENTRIES
- Proxy entries describe the addresses clients can only reach through other SOCKS servers and identify how the daemon contacts the host. The daemon contacts the host directly when the configuration file does not contain an entry for that host.
- .RS 5
- .PP
- .I proxy-type dest-host dest-port proxy-list
- .RE
- .PP
- .TP 15
- fIproxy-typefP
- Specifies the type of proxy server. Valid entries include:
- .RS 20
- .TP 10
- socks5
- SOCKSv5
- .TP
- socks4
- SOCKS version 4
- .TP
- noproxy
- Make direct connection
- .RE
- .TP 15
- .B fIdest-hostfP
- Must be a valid fIhostpatternfP
- .TP
- .B fIdest-portfP
- Must be a valid fIportpatternfP
- .TP
- .B fIproxy-listfP
- Must be a valid fIproxypatternfP and identifies the proxy server(s) to use.
- .PP
- The daemon uses the servers in fIproxy-listfP to connect to fIdest-portfP on fIdest-hostfP. The servers is fIproxy-listfP must be the same type servers as fIproxy-typefP.
- .PP
- .SH ACCESS CONTROL ENTRIES
- The access control section determines when the server permits or denies a request to establish a connection. The socks5 daemon denies a request if an access control line does not match the request, even after it has authenticated the host.
- .PP
- There are two types of lines, permit lines and deny lines, with this syntax:
- .PP
- .RS 5
- permit fIauth cmd src-host dest-hostfP \
- .RE
- .RS 8
- fIsrc-port dest-port [user-list]fP
- .RE
- .PP
- .RS 5
- deny fIauth cmd src-host dest-hostfP \
- .RE
- .RS 8
- fI src-port dest-port [user-list]fP
- .RE
- .PP
- .TP 12
- .B fIauthfP
- Must be a valid fIauthpatternfP and specifies a list of authentication methods.
- .TP
- .B fIcmdfP
- Must be a valid fIcommandpatternfP and specifies the commands clients on fIsrc-hostfP can execute on fIdest-hostfP.
- .TP
- .B fIsrc-hostfP
- Must be a valid fIhostpatternfP
- .TP
- .B fIdest-hostfP
- Must be a valid fIhostpatternfP
- .TP
- .B fIsrc-portfP
- Must be a valid fIportpatternfP
- .TP
- .B fIdest-portfP
- Must be a valid fIportpatternfP
- .TP
- .B fIuser-listfP
- Must be a valid fIuserpatternfP.
- .PP
- The entire line matches only when all the entries match.
- .PP
- .SH PATTERNS
- .SH fIhostpatternfP
- socks5 requires host addresses and netmasks to determine the hosts that apply to a socks5.conf entry. Specify the host/mask pair as a fIhostpatternfP, using the format:
- .TP 15
- .B hostip/mask
- Matches when a host address bitwise anded with the mask equals the hostip anded with the mask. Use the hostip/mask to mask the host portion of the address from the network or subnetwork portion.
- .TP
- .B -
- all hosts match
- .TP
- .B n1.
- equivalent to n1.0.0.0/255.0.0.0
- .TP
- .B n1.n2.
- equivalent to n1.n2.0.0/255.255.0.0
- .TP
- .B n1.n2.n3.
- equivalent to n1.n2.n3.0/255.255.255.0
- .TP
- .B .domain.name
- hostname must end with .domain.name
- .TP
- .B a.host.name
- hostname must match exactly with a.host.name.
- .PP
- Although socks5.conf supports older fIhostpatternfP syntax, we recommend using the newer method. The newer method is also easier to read. The older fIhostpatternfP syntax is:
- .RS 5
- .TP 15
- .B hostip/a
- all hosts match, same as "-"
- .TP
- .B hostip/n
- network match. Masks the host and subnet portions of the address, leaving the network portion. The IP address class for hostip determines the mask.
- .TP
- .B hostip/s
- subnet match. Masks the host portion of the address, leaving the subnetwork and network portion. The IP address class for hostip determines the mask.
- .TP
- .B hostip/h
- host match, the same as hostip
- .RE
- .PP
- .SH fIportpatternfP
- Specify ports in a fIportpatternfP as a service name, number, or range. Enclose ranges in brackets to indicate the range is inclusive, or parentheses to indicate the range is non-inclusive. Specify the range as two port names or numbers, separated by a comma, with no white space.
- .RS 5
- .TP 15
- .B tftp
- the service port for tftp, usually port 69
- .TP
- .B 80
- port 80
- .TP
- .B -
- all ports
- .TP
- .B [100,1000]
- ports 100 through 1000
- .TP
- .B (100,1000)
- ports 101 through 999
- .TP
- .B (100,1000]
- ports 101 through 1000
- .RE
- .PP
- .SH fIauthpatternfP
- Specify authentication methods in an fIauthpatternfP as a comma separated list of letters, with no white space. The socks5 daemon checks fI auth-methodsfP in reverse order, beginning with the last fIauth-methodfP in fI authpatternfP. socks5.conf recognizes these authentication methods:
- .RS 5
- .TP
- .B n
- No authentication. If you built the socks5 daemon with ident, the server authenticates UNIX users.
- .TP
- .B u
- Username/Password
- .TP
- .B k
- Kerberos 5 (GSS-API)
- .TP
- .B -
- any authentication method
- .RE
- .PP
- The last fIauth-methodfP listed takes precedence over the methods listed first. For example, if you list:
- .RS 5
- .PP
- n,u,k
- .PP
- .RE
- the server requests Kerberos authentication for socks5 clients. If the socks5 client is not set up to use Kerberos, the server uses Username/Password authentication.
- .PP
- Since SOCKS4 clients can not use Kerberos or Username/Password authentication, the server does not require authentication for SOCKS4 clients.
- .PP
- If you list:
- .RS 5
- .PP
- n,k,u
- .PP
- .RE
- the server requests Username/Password authentication for socks5 clients. Since SOCKS4 clients can not use Username/Password or Kerberos authentication, the server does not require authentication for SOCKS4 clients.
- .PP
- .SH fIcommandpatternfP
- Specify commands in a fIcommandpatternfP as a comma separated list of letters, with no white space. socks5.conf recognizes these commands:
- .RS 5
- .TP
- .B c
- connect
- .TP
- .B b
- bind
- .TP
- .B u
- UDP
- .TP
- .B p
- ping
- .TP
- .B t
- traceroute
- .TP
- .B -
- all commands
- .RE
- .PP
- .SH fIuserpatternfP
- Specify multiple users in a fIuserpatternfP as a comma separated list of individual users, with no white space and no wild card patterns.
- .PP
- The user type must match the authentication method. For example, when you specify Username/Password authentication, the socks5 daemon expects socks5 users. When you specify Kerberos authentication, the socks5 daemon expects Kerberos users. A dash, -, matches all users.
- When you specify u and k in the fIauthpatternfP, fIuserpatternfP can contain valid Kerberos and socks5 users.
- .PP
- .SH fIproxypatternfP
- Specify socks5 daemons in a fIproxypatternfP as a comma separated list of fIserver-entriesfP, with no white space.
- .PP
- Specify servers in order of preference. The client attempts to connect to servers in the order in which they are listed in the fIproxypatternfP. It only attempts connections to a server when the preceeding server is not available.
- .PP
- .SH fIserver-entriesfP
- A server entry is a hostname or IP address, optionally followed by a colon and the port number, with no white space. When you omit the port number, socks5 uses the default port.
- .RS 5
- .TP 15
- .B host
- hostname, default port
- .TP
- .B host:port
- hostname, specified port
- .PP
- .RE
- .PP
- .SH EXAMPLES
- Refer to the examples directory for more complete examples.
- .PP
- .RS 5
- auth - - k
- .br
- permit k - 111.111.111. - - -
- .RE
- .PP
- Only kerberos authenticated users from the class C network 111.111.111.0 can use the server.
- .PP
- .RS 5
- socks5 - - s5srv1,s5srv2
- .br
- permit - - .mydomain.com - - -
- .RE
- .PP
- All socks5 requests connect through s5srv1. If s5srv1 is not available, all socks5 requests connect through s5srv2. Only clients from .mydomain.com can use the server.
- .PP
- .RS 5
- auth otherserver - k
- .br
- noproxy .internal.net.com -
- .br
- socks5 - - otherserver
- .br
- permit - - .internal.net.com - - -
- .br
- permit k - otherserver - - -
- .br
- .RE
- .PP
- Clients from .internal.net.com can use the server without kerberos authentication.
- The socks5 server will connect directly to .internal.net.com hosts and proxy through
- another socks5 server, otherserver, for other hosts. For the other socks5 server,
- otherserver, to proxy through this socks5 server, it must authenticate with kerberos.
- .PP
- .SH POOR CONFIGURATIONS
- As with any software that has security issues, proper configuration is a fBmustfP. The
- line
- .PP
- permit - - - - - -
- .PP
- should never be used. With this configuration, malicious users could use the socks5
- server to hide their attack of other systems. Always try to restrict based on source
- or destination host.
- .PP
- .SH SEE ALSO
- socks5(1), libsocks5.conf(5), sockd4_to_5.pl(1)
- .PP
- .SH AUTHORS
- NWSL SOCKS5 Development Team
- .PP
- Send comments to socks5-comments@socks.nec.com