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
84
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
75
OCI Stack Monitoringでリソース監視をする
yukitkns
1
1k
WAFログの推奨ルールを確認する
yukitkns
0
67
OCI ロギングでカスタム・ログを収集する
yukitkns
1
910
「寺子屋Oracle Cloud:Win Story研究会『ハイブリッドクラウド・マルチクラウド』」に参加してみて
yukitkns
1
200
開発未経験者がはじめて DevOpsを触ってみた
yukitkns
0
200
「寺子屋Oracle Cloud:Win Story研究会『OCVSのリフト案件』」に参加してみて
yukitkns
0
210
ここがスゴいよ、OCM!!
yukitkns
1
180
Other Decks in Programming
See All in Programming
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
170
Getting Started with Vibe Coding
miccheng
0
150
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
230
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
110
Kotlinの15年とServer-Side Kotlin
n_takehata
1
190
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
190
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
250
Groovy as a human and AI friendly programming language
paulk
0
160
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
320
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
0
100
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.1k
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
55
8.4k
Claude Code のすすめ
schroneko
67
230k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Crafting Experiences
bethany
1
400
Balancing Empowerment & Direction
lara
6
1.4k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
500
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.3k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
2
990
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
470
Side Projects
sachag
456
43k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
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