This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 3 years have passed since last update.

中継サーバーを作成する

Last updated at Posted at 2020-01-27

①AWSのサービス項目でEC2を選びます。
image.png
②EC2ダッシュボードでは「Lauch instance」でインスタンスを作成します。
image.png

③「Choose an Amazon Machine Image (AMI)」では今回「Amazon Linx 2 AMI (HVM), SSD Volume Type 64-bit (x86)」を選んで、「Select」で進めてください。
image.png
④「Choose an Instance Type」では今回t2.microを選んで「Next: Configure Instance Details」ボタンを進めてください。
image.png
⑤「Configure Instance Details」では以下のように操作してください。

  • 「network」VPCを選択
  • 「subnet」subnetを選択
  • 「auto-assign public IP」項目でEnableを選択

image.png

※なお、適当なVPC・subnetがない場合は「Create new VPC」からVPC、Subnetを作成します。作成方法については以下の記事でもご紹介しています。必要に応じご参照ください。
>>VPC,subnetを作成する

⑥「Step4:Add Storage」に進みサイズ(GIB)を指定して、「Next: Add Tags」をクリックしてください。
image.png
⑦「Step5:Add tags」でタグをつけてください。この操作は任意です。
「Next: Configure Security Group」を押して次のステップに進んでください。
image.png

⑧「Configure Security Group」で以下の通り、情報を入力します。

  • 「Assign a security group」で「Create a new security group」を選択
  • 「Security group name」に任意の名前を入力
  • 「Description」にデスクリプションを入力(任意)
  • 「Add Rule」でルールを追加し、「Custom TCP」を選択し、「Port Range」に1024-65535 を入力 image.png

「Review and Launch」ボタンをクリックしてください。

⑨インスタンスを確認して、「Launch」ボタンをクリックしてください。
image.png

⑩キーペアが無ければ、「Create a new key pair」を選択し、「Key pair name」に任意の名前を入力して、「Download Key Pair」をクリックして、「Launch Instances」を進めてください。
image.png

⑪インスタンスの作成が完了したら、確認するために「View Instances」ボタンをクリックしてください。
image.png
「Instances」画面で作成したインスタンスが表示されます。

以上で中継サーバーの作成は完了です。

サーバーを立ち上げてアクセスするには。。

①EC2のダッシュボードから先ほど作成したインスタンス(中継サーバー)を選んで、「Connect」をクリックしてください。
image.png

②接続情報が表示されます。
image.png

③先ほどキーペアを格納したフォルダでコマンドを開いて、上記画面に記載のコマンドを実行し中継サーバーにアクセスします。
<例>
権限付与:chmod 400 keypair-test.pem
     (keypair-test.pemは先ほど作成したキーペアです。)
中継サーバーにアクセス:ssh -I “keypair-test.pem” ec2-user@
image.png

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