⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 socks.conf.5

📁 Linux下的socks的程序源程序,用于socks的代理服务
💻 5
字号:
.TH SOCKS.CONF 5 "February 9, 1994".SH NAME.nfsocks.conf \- SOCKS clients configuration file.fi.SH SYNOPSIS/etc/socks.conf.SH DESCRIPTIONAll SOCKS client programs use this file to determine whether touse direct or proxy connection to a given destination host, andto exert access control based on the destination host, the requestedservice (port number on the destination host), and the effective user-idof the requesting local user. If this file is absent, SOCKS clients willonly try direct connections, making them behave like their regular counterparts.Each line in the file may be up to 1024 characters long.Lines starting with a \fB#\fP are comments. Non-comment lines must beof one of the three forms:.nf.+1\fBdeny	\fI[\fB*=\fIuserlist]   dst_addr  dst_mask  [op dst_port]  [: shell_cmd]\fP\fBdirect	\fI[\fB*=\fIuserlist]   dst_addr  dst_mask  [op dst_port]  [: shell_cmd]\fP\fBsockd	\fI[\fB@=\fIserverlist]	[\fB*=\fIuserlist]  dst_addr  dst_mask  [op dst_port]  [: shell_cmd]\fR.-1.fiA \fBdeny\fP line tells the SOCKS clients when to reject a request.A \fBdirect\fR lines tells when to use a direct connection. A \fBsockd\fRline indicates when to use a proxy connection and, optionally, whichSOCKS proxy server or servers it should try.Spaces and tabs separate the fields. Fields enclosed in square bracketsare optional.The \fIuserlist\fR field, when present, consists ofone or more user-ids or filenames, with comma as separator. No spacesor tabs are allowed in the list. The user-ids should be ids of users on thelocal host, not those on the destination host or the SOCKS server host.The filenames must be full pathnames with the leading \fB/\fP. Insidethe specified files, user-ids may be listed one or several per line,with any combination of blanks, tabs, and commas as separators. Theappearance of \fB#\fP marks the remainder of the line as comment. Eachline in the files may be up to 1023 characters long.If the \fB*=\fIuserlist\fR field is omitted, the line applies to all user-ids.The \fIdst_addr dst_mask\fP pair together specify the destination IP addressor the range of destination IP addresses. They are both given in theusual dotted form, e.g., 129.1.2.3. Bits in \fIdst_mask\fP that are setto 0 indicate the bit positions which should be masked off (i.e., ignored)during comparison of \fIdst_addr\fP and the actual destination IP address.So specifying 255.255.255.255 in \fIdst_mask\fP demands an exact matchwith \fIdst_addr\fP, whereas 0.0.0.0 in \fIdst_mask\fP causes an addressmatch no matter what is specified for \fIdst_addr\fP. (NOTE: This is thesame way netmasks are interpreted, but is the direct opposite of how theaddress masks are used in cisco router's access-lists.)The \fIop\fP field must be \fBeq\fR, \fBneq\fR, \fBlt\fR, \fBgt\fR,\fBle\fR, or \fBge\fR, for the condition of equal, not equal, less than,greater than, less than or equal, and greater than or equal, respectively.The \fIdst_port\fP field can be either a port number, e.g., 23, or theequivalent service name as specified in file /etc/services, e.g., \fBtelnet\fRfor port number 23. If this pair is omitted, the line applies to allservices.The \fIserverlist\fP, which may only be used in a \fBsockd\fR line,consists of one or more SOCKS proxy servers, which the client program shouldtry to use (in the indicated order) for establishing a proxy connection.Only commas can be used as separator, no spacesor tabs are allowed in the list. Domain names of the servers may be usedin the list, though it is probably more prudent to specify IP addresses.If this field is omitted, the client program will use thedefault SOCKS proxy server, which is determined by the environment variable\fBSOCKS_SERVER\fR if it exists, or the name compiled into the SOCKS clientprogram otherwise.Consider.nf.+1sockd  @=1.2.3.4  *=boss,root 11.12.13.14 255.255.255.255 eq telnet.-1.fiTo match the condition indicated in this line, a request must come froma local user whose effective id is either boss or root, the destinationIP address must be 11.12.13.14 exactly, and the service requested mustbe telnet. In that case, connection to host 11.12.13.14 should be donevia a SOCKS proxy server on host 1.2.3.4.Every time a SOCKS client has to make a network connection, it checksthe pending request against the file \fB/etc/socks.conf\fR, one line ata time. Once it finds a line with conditions that are matched by therequest, the action specified on that line is taken. The remaininglines of file \fB/etc/socks.conf\fR are skipped. So the order of thelines in the file is extremely important; switch two lines and you mayhave entirely different results.  If no matching lineis found throughout the file, the request is denied.The \fIshell_cmd\fR field specifies a command string that is executedwhen the conditions on that line are satisfied. The following substitutionsoccur before the string is presented to the Borne shell for execution:.nf.in +1%A -- replaced by the client host's domainname if known, by its IP address otherwise%a -- replaced by the client host's IP address%c -- replaced by "connect" or "bind"%p -- replaced by the process id of the client program%S -- replaced by the service name (e.g., ftp) if known, by the destination port number otherwise%s -- replaced by the destination port number%U -- replaced by the user-id at login%u -- replaced by the effective user-id%Z -- replaced by the destination host's domainname if known, by its IP address otherwise%z -- replaced by the destination host's IP address%% -- replaced by a single %.fi.in -1Several shell commands can be strung together in the usual way with `|',`;', etc.Although there is an implied 'deny all' at the end of the control file,you may supply one explicitly so as to take some specific action when requestsare so rejected, e.g.,.nf.in +1deny 0.0.0.0 0.0.0.0 : /usr/ucb/mail -s 'SOCKS: rejected %S from %u to %Z' root.fi.in -1Unlike the previous version, connection to address 127.0.0.1 or 0.0.0.0is always done directly to localhost, so there is no need to specifyeither of them in\fB/etc/socks.conf\fP..SH ENVIRONMENT\fBSOCKS_SERVER\fR, if defined, specifies the name or IP address of theSOCKS proxy server host to use, overriding the default servercompiled into the programs..SH SEE ALSO\fIsockd\fP(8), \fIsocks_clients\fP(1), \fIsockd.conf\fP(5)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -