業界トップクラスの求人数を誇る転職エージェントPR

リクルートグループのコネクションを活かした非公開求人も充実、他にはない好条件の求人と出会える

0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

プライベートサブネットのEC2インスタンスにSSHする

Posted at

前提

マルチAZ構成ですでにEC2インスタンスは2つ起動済み。

流れ

  1. キーペアをパブリックサブネット内のEC2インスタンスに保存
  2. パブリックサブネットのインスタンスへSSH
  3. パブリックサブネットを踏み台に、保存したキーペアを用いてプライベートサブネットへSSH

SCPコマンド

キーペアをパブリックサブネットに保存するには、scpコマンドを使う。

// scpコマンドで秘密鍵(送りたいもの)を送信する
scp -i 秘密鍵 送りたいもの ユーザ名@パブリックIP:/送信先
scp -i sample.pem sample.pem ec2-user@パブリックIPアドレス:/任意のディレクトリ

パブリックサブネットからプライベートサブネットへSSH

ssh -i sample.pem ec2-user@プライベートIPアドレス
0
0
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

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?