Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
多段接続について
Search
yukitkns
February 04, 2024
Programming
82
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
多段接続について
yukitkns
February 04, 2024
More Decks by yukitkns
See All by yukitkns
Let's EncryptでSSL証明書を自動更新
yukitkns
1
72
OCI Stack Monitoringでリソース監視をする
yukitkns
1
930
WAFログの推奨ルールを確認する
yukitkns
0
65
OCI ロギングでカスタム・ログを収集する
yukitkns
1
900
「寺子屋Oracle Cloud:Win Story研究会『ハイブリッドクラウド・マルチクラウド』」に参加してみて
yukitkns
1
190
開発未経験者がはじめて DevOpsを触ってみた
yukitkns
0
200
「寺子屋Oracle Cloud:Win Story研究会『OCVSのリフト案件』」に参加してみて
yukitkns
0
200
ここがスゴいよ、OCM!!
yukitkns
1
180
Other Decks in Programming
See All in Programming
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
170
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
360
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
890
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
360
パーソナライズPodcastを作った話
repunit11
0
130
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
210
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.5k
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
140
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
190
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
160
R8 の設定見直しでアプリサイズ削減
andpad
0
190
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
400
Rails Girls Zürich Keynote
gr2m
96
14k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
350
How to build a perfect <img>
jonoalderson
1
6.1k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
Six Lessons from altMBA
skipperchong
29
4.5k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
350
The agentic SEO stack - context over prompts
schlessera
0
970
Designing Experiences People Love
moore
143
24k
Transcript
踏み台サーバ経由で 多段接続を実施
従来のプライベート・サブネットにある サーバの接続方法 1. 踏み台サーバ経由で接続 ・手順が簡素 ・踏み台サーバに秘密鍵を配置するため、セキュアな接続方法ではない 2. ポートフォワーディングで接続 ・ローカルの秘密鍵を使用するので、セキュアに接続可能 ・コマンドを複数回実行する必要があり、かつ長文で複雑
多段接続とは? l異なるネットワークセグメントやセキュリティゾーンに存在する複数のコ ンピュータやサーバに、SSHや他のプロトコルを使用して順次接続する セキュリティ手法。 →コマンド一文のみでプライベート環境にあるサーバに接続する事が可能 l多段接続は2つ方法がある 1. ワンライナーで実行 2. ~/.ssh/configに記述
ワンライナーで実行 l以下のコマンドを使用 ssh -o ProxyCommand=‘ssh -i <踏み台サーバの秘密鍵のパス> -W %h:%p opc@<踏み台サーバの
パブリックIPアドレス>’ -i <目的サーバの秘密鍵のパス> opc@<目的サーバのプライベートIPアドレス> l ssh -o ProxyCommand=‘ssh -i <踏み台サーバの秘密鍵のパス> -W %h:%p opc@<踏み台サーバのパブリック IPアドレス > :目的のホストに直接接続せず、指定されたプロキシコマンドを使用して中継経由で接続を確立。 l -W %h:%p:プロキシサーバを通してトンネルを確立するためのオプション。 lSCPコマンドでファイル転送を行う場合 scp -o ProxyCommand=‘ssh -i <踏み台サーバの秘密鍵のパス> -W %h:%p opc@<踏み台サーバの パブリックIPアドレス>’ –i <目的サーバの秘密鍵のパス> <転送対象のファイル> opc@<目的サーバの プライベートIPアドレス>:<転送先のパス>
ローカルPC 踏み台サーバ vm-tokyo 138.2.25.12 目的サーバ private 10.0.1.215 VCN(10.0.0.0/16) 秘密鍵 踏み台サーバ:~/Desktop/key/test.key
目的サーバ: ~/Desktop/key/private.key
~/.ssh/configに記述 l右の内容を記述 ログイン時は「ssh <ホスト名>」のみで目的 サーバに接続可能 lSCPコマンドでファイル転送を行う場 合 scp -i <目的サーバの秘密鍵のパス>
<転送 対象のファイル> <目的サーバのホスト名>: <転送先のパス> ※ProxyCommandをProxyJumpに変更
ユースケース lワンライナーで実行 l configファイルに設定不要で接続可能 l configに書き込むより、コマンドが長く直感的に実行できない l~/.ssh/configに記述 l ログイン時にホスト名のみで可能 l
事前にconfigファイルに記述が必要 l ホスト名は重複不可で、事前にホスト名の定義を行う必要がある
出典 「踏み台サーバ経由の多段SSH接続をローカル端末の秘密鍵のみで実施する」 https://dev.classmethod.jp/articles/bastion-multi-stage-ssh-only-local-pem/ 「多段 ssh するなら ProxyCommand じゃなくて ProxyJump を使おう」
https://zenn.dev/kariya_mitsuru/articles/ed76b4b27ac0fc