歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux服務器 >> Debian Linux系統Socks5服務器安裝方法

Debian Linux系統Socks5服務器安裝方法

日期:2017/3/2 16:47:59   编辑:Linux服務器

[1] 下載

http://www.haikuo.googlepages.com/socks5-v1.0r11.patched.tgz

[2] 編譯

$ ./configure ——with-threads ——with-srvconffile=/etc/socks5/config ——with-srvpwdfile=/etc/socks5/passwd

$ make

[3] 安裝

$ sudo make server.install

[4] 配置

$ vim /etc/socks5/config

### A socks5 Config file to use between 2 servers, using a VPN

#

# auth source-host source-port auth-methods

# permit auth cmd src-host dest-host src-port dest-port [user-list]

# deny auth cmd src-host dest-host src-port dest-port [user-list]

# Proxy lines are of the form:

# proxy-type dest-host dest-port proxy-list

# socks4 dest-host dest-port proxy-list

# socks5 dest-host dest-port proxy-list

# noproxy dest-host dest-port proxy-list

# set SOCKS5_BINDINFC 9301

# SOCKS4

set SOCKS5_V4SUPPORT

#

set SOCKS5_MAXCHILD 30

#

set SOCKS5_TIMEOUT 15

set SOCKS5_NOIDENT

set SOCKS5_DEMAND_IDENT

#

# set SOCKS5_PWDFILE /etc/socks5.pwd

# 用戶認證方式

auth - - u

# 允許所有IP的用戶

permit u - - - - - -

# 若限制某個IP段(192.168.0.0/255.255.255.0)可訪問

#permit - - 192.168.0. - - -

# 若限制某個IP( 192.168.0.10)可訪問

#permit - - 192.168.0.10 - - -

deny - - - - - -

# 級連

# socks4 - - 202.110.217.75:1080

# socks5 - - 61.167.58.77:1080

然後是密碼文件

$ vim /etc/socks5/passwd

# userA passwd

userA passA

[5] 啟動服務

確定你的 /etc/services 文件中有包含 socks的描述,否則就手動加入

$ vim /etc/services

socks 1080/tcp # socks proxy server

socks 1080/udp

服務采用inetd的方式

在 /etc/inetd.conf 中加入

$ vim /etc/inetd.conf

#socks5 server

socks5 stream tcp nowait root /usr/local/bin/socks5 socks5 -i

重啟 inetd

$ sudo /etc/init.d/inetd restart

現在, 一個socks5的服務就啟動了

Copyright © Linux教程網 All Rights Reserved