1:确保操作系统中已经有了gcc和make编译套件;(如果没有需要安装)
2:确保代理者上装好了Clash-for-Windows;
①:安装好Clash-for-Windows。
②:进入主页选择一个端口。
③:打开允许局域网。
3:确保被代理者已经装好了tsocks(下面简单描述一下离线安装);
①:在官网下载好tsocks后,解压到任意目录,进入tsocks目录。
②:查看INSTALL文件根据自己的需要去执行./configure 命令,如果没有特殊需求,直接执行 ./configure 即可。
③:执行make install,等待编译安装完成。
4:根据代理服务器的IP和端口修改tsocks的配置文件,配置文件默认是:/etc/tsocks.conf。
将其内容改成以下几行并保存退出:
local =192.168.2.0/255.255.255.0 #local表示本地的网络,也就是不使用socks代理的网络
server =192.168.3.5 # SOCKS 服务器的 IP
server_type =5 # SOCKS 服务版本 默认是4 ,绝大多数使用5即可
server_port =9999 #SOCKS 服务使用的端口
你可能需要修改一下以上内容
5: 分享一下个人的tsocks配置文件#################################
# This is the configuration forlibtsocks(transparent socks)
# Lines beginning with # and blank lines are ignored
#
# The basic idea is to specify:
# - Local subnets - Networks that can be accessed directly without
# assistance from a socks server
# - Paths - Paths are basically lists of networks and a socks server
# which can be used to reach these networks
# - Default server -A socks server which should be used to access
# networks for which no path is available
# Much more documentation than provided in these comments can be found in
# the man pages,tsocks(8) and tsocks.conf(8)
# Local networks
# For this example this machine can directly access 192.168.0.0/255.255.255.0
# (192.168.0.*) and 10.0.0.0/255.0.0.0(10.*)
local =192.168.2.0/255.255.255.0
local =192.168.3.0/255.255.255.0
# Paths
# For this example this machine needs to access 150.0.0.0/255.255.0.0as
# well as port 80 on the network 150.1.0.0/255.255.0.0 through
# the socks 5 server at 10.1.7.25(ifthis machines hostname was
# "socks.hello.com" we could also specify that, unless --disable-hostnames
# was specified to ./configure).
path {
reaches =150.0.0.0/255.255.0.0
reaches =150.1.0.0:80/255.255.0.0
server =10.1.7.25
server_type =5
default_user = delius
default_pass = hello
}
# Default server
# For connections that aren't to the local subnets or to 150.0.0.0/255.255.0.0
# the server at 192.168.0.1 should be used(again, hostnames could be used
# too, see note above)
server =192.168.3.5
# Server type defaults to 4 so we need to specify it as5forthis one
server_type =5
# The port defaults to 1080 but I've stated it here for clarity
server_port =9999
####################################
6:配置完成后,保存退出。
7:运行软件
用 tsocks 运行你的软件很简单,在终端中:
tsocks 你的软件
如:
tsocks firefox;
tsocks ssh -p 9022 gobills@10.1.1.109
tsocks apt install vim