easy ssh tunnel and proxy

很簡單,開個1080 port 再自己這邊,另一邊是國內的ssh主機,就完成了!

ssh -C2qTnN -D 1080 thomas@home.linuxserver.com

-C Requests compression of all data
-2 Forces ssh to try protocol version 2
-q Quiet mode
-T Disable pseudo-tty allocation
-N results in no login prompt
-n prevents reading from stdin
-D provides dynamic application-level port forwarding. In this case, using 1080, the default SOCKS port as defined by IANA

接著,shell 裏面設定也是麻煩,有的還不吃環境變數,只好來個 tsock, 設定檔裏面設定

server = 127.0.0.1

server_port = 1080

再去執行 tsock , 什麼都沒發生但是已經是proxy shell 了,熱和從這邊出去的指令都會走 127.0.0.1:1080

Comments