歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Linux中任意軟件通過代理上網(非vpn)

Linux中任意軟件通過代理上網(非vpn)

日期:2017/3/1 17:16:11   编辑:關於Linux

Linux中任意軟件通過代理上網(非vpn) 在windows中,有 SocksCap32、 ProxyCap、FreeCap、Proxifier 能夠實現任意軟件通過代理上網了,本博在之前有介紹過: http://www.2cto.com/net/201207/142900.html ,在ubuntu等linux發行版中如何實現呢? 當然,前提是你要先鏈接好ssh加密通道,或者支持socks4/5的連接方式。准備好後,就可以利用以下兩種方法實現。 方法一: 安裝proxychains sudo apt-get install proxychains 修改配置文件 (/etc/proxychains.conf),如下: www.2cto.com # proxychains.conf VER 2.0 # # HTTP, SOCKS4, SOCKS5 tunneling proxifier. # # The option below identifies how the ProxyList is treated. # only one option should be uncommented at time, # otherwise the last appearing option will be accepted # # Dynamic - Each connection will be done via chained proxies # all proxies chained in the order as they appear in the list # at least one proxy must be online to play in chain # (dead proxies are skipped) # otherwise EINTR is returned to the app # # Strict - Each connection will be done via chained proxies # all proxies chained in the order as they appear in the list # all proxies must be online to play in chain # otherwise EINTR is returned to the app # www.2cto.com # Random - Each connection will be done via random proxy # (or proxy chain, see chain_len) from the list # this option is good for scans dynamic_chain #strict_chain #random_chain # Make sense only if random_chain chain_len = 2 # Quiet mode (no output) #quiet_mode # Write stats about good proxies to proxychains.stats #write_stats #Some timeouts in milliseconds # tcp_read_time_out 15000 tcp_connect_time_out 10000 www.2cto.com [ProxyList] # ProxyList format # type host port [user pass] # (values separated by 'tab' or 'blank') # # # Examples: # # socks5 192.168.67.78 1080 lamer secret # http 192.168.89.3 8080 justu hidden # socks4 192.168.1.49 1080 # http 192.168.39.93 8080 # # # proxy types: http, socks4, socks5 # ( auth types supported: "basic"-http "user/pass"-socks ) ##http 10.0.0.5 3128 socks5 127.0.0.1 7070 socks4 127.0.0.1 9050 注意事項: 要選 dynamic_chain 而不是 random_chain 可以列舉幾個代理服務器,proxychains 會按順序用,代理無法訪問即自動選用下一個 代理服務器要根據自己電腦的情況自行調整 運行 proxychains www.2cto.com 在終端中輸入: proxychains 你的軟件 & 方法二: Tsocks是另一個能夠強迫任何軟件通過SOCKS代理上網的工具。 安裝並配置 Tsocks 在終端中: sudo apt-get install tsocks 修改配置文件: sudo nano /etc/tsocks.conf 將其內容改成以下幾行並保存退出: local = 192.168.1.0/255.255.255.0 #local表示本地的網絡,也就是不使用socks代理的網絡 server = 127.0.0.1 # SOCKS 服務器的 IP server_type = 5 # SOCKS 服務版本,4或5 server_port = 9999 #SOCKS 服務使用的端,根據自己的情況自行修改 你可能需要修改一下以上內容,用你自己的 SSH 隧道設置。 運行軟件 用 tsocks 運行你的軟件很簡單,在終端中: tsocks 你的軟件 & 下面以ssh通道與tsocks為例: www.2cto.com 1:申請一個shell,網上有收費的,不過也有免費的(速度有點慢);個人在http://www.cjb.net/ 申請的免費shell。(以前這個網站被封了) 2:使用ssh命令使用你申請時的帳號登錄shell.cjb.net(Address: 216.194.70.6)(如果dns不能解析這個url,可以使用ip地址。)具體如下: ssh -D 9999 216.194.70.6 -l shellacount [解釋:D選項指示你選擇7070端口,l選項用於標明你的用戶名,ip地址代表你將要登錄的主機] 3:配置/etc/tsocks.conf,tsocks 你的軟件 & ~OK!!! 作者 acmfly
Copyright © Linux教程網 All Rights Reserved