2016年9月16日 星期五

ssh tunnel

修改20160916

目的

示範使用linux與windows的putty製作ssh tunnel連線

tolopogy


local host需要在forward host上建立ssh tunnel並連到remote host
local host必須要能夠在forward host上建立ssh連線
local host在自己身上選定port當作通道
選定remote host的ip與port

完成後local host使用自己的port連到remote host的ip和port,remote host只會看到是forward host與他建立連線


windows/linux(unix)實作

使用windows 10, putty, ip 10.10.10.10

1.putty->category->connection->SSH->Turrenls
Source port 22222是在local host建立port
Destination 10.10.9.2:22是建立連到remote host的ip和port

2.local host與forward host 10.10.10.22建立連線

3.建立ssh tunnel完成

4.利用ssh tunnel與remote host做ssh連線

5.驗證,在remote host上可以看到登入的ip是10.10.9.1

使用macbook, terminal, ip 10.10.10.1

1.-N 不會執行對方的命令,就是不需要操作forward host
-f 背景執行
-L 後面接ip和port設定
完整指令 ssh -N -f -L [local port]:[remote ip]:[remote port]  [forward host]

驗證



沒有留言:

張貼留言