差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

下次修改
前次修改
tech:ssh_tunnel [2008/10/08 09:42] – 建立 jonathantech:ssh_tunnel [2021/01/16 14:40] (目前版本) – 更換 plugin jonathan
行 1: 行 1:
 +====== 建立 SSH Tunnel 語法 ======
 +這是兩年前寫在舊 blog 上面的紀錄, 剛好今天要用到, 所以就拉出來整理在這邊..  --- //[[[email protected]|蔡宗融]] 2008/10/08 09:42//
 +
 +==== - 透過遠端 InterServer-B 的主機連進來 IntraServer-A 的主機 ====
 +{{https://www.ichiayi.com/blog/images/ssh_tunnel/ssh_tunnel_1.gif}}
 +  * 先登入 IntraServer-A 
 +  * 執行 <cli>
 +ssh -nNT -R 9022:192.168.0.39:22 [email protected] 
 +</cli>
 +    * 由 IntraServer-A 以 jonathan 身分 ssh 連上 InterServer-B
 +    * 同時建立 ssh tunnel, 讓 InterServer-B 所 Listen 的 Port 9022 就是通到 IntraServer-A 的 Port 22 
 +  * 這時在 InterServer-B 內下 ssh engineer@localhost -p 9022 就可以由 InterServer-B 以 engineer 身分 ssh 連上 IntraServer-A
 +
 +==== - 透過遠端 InterServer-B 的主機經 IntraServer-A 連進來 IntraServer-C 的主機 ====
 +{{https://www.ichiayi.com/blog/images/ssh_tunnel/ssh_tunnel_2.gif}}
 +  * 先登入 IntraServer-A
 +  * 執行 <cli>
 +ssh -nNT -R 9022:10.1.1.2:22 [email protected]
 +</cli>
 +    * 由 IntraServer-A 以 jonathan 身分 ssh 連上 InterServer-B
 +    * 然後建立 ssh tunnel, 讓 InterServer-B 所 Listen 的 Port 9022 就是通到 IntraServer-C 的 Port 22 
 +  * 這時在 InterServer-B 內下 ssh engineer@localhost -p 9022 就可以由 InterServer-B 以 engineer 身分 ssh 連上 IntraServer-C
 +
 +{{tag>ssh tunnel 密技}}