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
68
OCI Stack Monitoringでリソース監視をする
yukitkns
1
850
WAFログの推奨ルールを確認する
yukitkns
0
63
OCI ロギングでカスタム・ログを収集する
yukitkns
1
860
「寺子屋Oracle Cloud:Win Story研究会『ハイブリッドクラウド・マルチクラウド』」に参加してみて
yukitkns
1
180
開発未経験者がはじめて DevOpsを触ってみた
yukitkns
0
190
「寺子屋Oracle Cloud:Win Story研究会『OCVSのリフト案件』」に参加してみて
yukitkns
0
200
ここがスゴいよ、OCM!!
yukitkns
1
180
Other Decks in Programming
See All in Programming
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.5k
すこし踏み込む CancellationToken
htkym
1
360
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
150
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
280
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
240
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3k
wkhtmltopdfの次どうするか問題2026
willnet
2
1.3k
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
240
AIエージェント時代のコードレビューを設計する
nogu66
6
2.7k
setup-vp GitLab対応の裏側
naokihaba
0
110
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
290
App Intentsのビルドプロセスを支える技術
kntkymt
0
390
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
890
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
HDC tutorial
michielstock
2
870
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
530
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Unsuck your backbone
ammeep
672
58k
YesSQL, Process and Tooling at Scale
rocio
174
15k
4 Signs Your Business is Dying
shpigford
187
23k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
810
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