Quantcast
Channel: 初心者タグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 21499

AWS EC2間でSSH接続する

$
0
0

はじめに

  • AWS VPCの勉強がてら、管理用サブネット~公開サブネット間のSSH接続の試験をしたメモです。

Internal SSH

  • 公開サーバのインスタンス作成時に、キーペアを作成する。
  • TeraTermを使って、踏台サーバに、xxx.pemをSCPで送信する image.png
アップロードしたファイルのパーミッションを変更する
sudo chmod 600 xxx.pem
踏台サーバにコンフィグファイルを作る
touch ~/.ssh/config
vi .ssh/config
.ssh/config
Host wss
    HostName 172.10.0.xxx #IPアドレス
    User ubuntu
    IdentityFile ~/xxx.pem
    Port 22
ターゲットにssh接続する
ssh wss
yes/noを聞かれるので応答する
yes
接続完了
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-1057-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Wed Apr 15 09:47:18 UTC 2020

  System load:  0.12              Processes:           92
  Usage of /:   18.8% of 7.69GB   Users logged in:     0
  Memory usage: 18%               IP address for eth0: 172.10.0.xxx
  Swap usage:   0%


0 packages can be updated.
0 updates are security updates.


*** System restart required ***
Last login: Wed Apr 15 09:41:44 2020 from 172.10.200.xxx
ubuntu@ip-172-10-0-xxx:~$

ネットワークACL

ManagementNetworkACL

nwacl1.png

ExternalNetworkACL

image.png

セキュリティグループ

ManagedServer

Inbound

instanceInbound.png

Outbound

image.png


WebServiceServer

Inbound

instance2Inbound.png

Outbound

image.png

おわりに

  • ネットワークACLは、ステートレス
  • セキュリティグループは、ステートフル
  • WebServiceServerのセキュリティグループは、開発専用  - ポート:8000 → 80、ソース:0.0.0.0/0

Viewing all articles
Browse latest Browse all 21499

Latest Images

Trending Articles