LoginSignup
7
7

More than 5 years have passed since last update.

多段 ssh でどこまでも

Posted at

概要

少しへんてこな構成でとある検証を行っていて、nginx や apache で reverse proxy 設定するのも面倒くさいから多段 ssh で解決しちゃいましょうというのが始まりでした。久しぶりだったので忘れないようにメモ。

構成

localpc → 踏み台サーバ → 検証サーバ → 辿り着きたいサーバ

実施内容

  • 今回見たいのは上記の 辿り着きたいサーバ 80番ポート。要は Web です。
  • 全てのポート番号は任意で変えてください。
ssh -L 10080:localhost:9999 USER@踏み台サーバのアドレス

そのままログインできるので下記を実施。

ssh -L 9999:localhost:10000 UESR@検証サーバのアドレス

またそのままログインできるので下記を実施。
今回は80番ポートが対象なので80となります。

ssh -L 10000:localhost:80 USER@辿り着きたいサーバのアドレス

無事に手元の PC で辿り着きたいサーバの80番が閲覧できました。
めでたしめでたし。

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7