3 個答案
- 最新
- 最多得票
- 最多評論
0
Hi Yoplin,
I understand following is your setup:
- One EC2 instance is in private subnet on your AWS VPC.
- You want to SSH into this EC2 instance in private subnet.
Solution:
- Create a new EC2 instance in the public subnet. Lets call this instance as "EC2Public". This will have a public ip address.
- SSH into this EC2Public instance using putty.
- FTP the private key (.pem file) of your EC2 instance in private subnet (lets call this instance as EC2Private) on the EC2Public instance.
- Now from within this EC2Public instance terminal, you can use the SSH command to login to
EC2Private instance using the private ipaddress of EC2Instance private.
Following command can be used :
ssh -i <key location of .pem file> <username>@<privateIpOfEC2Instance>
5. You will be able to get connected to EC2Instance private instance.
6. In case you are getting error related to file permissions, execute following command on the .pem file
chmod 0400 <.pem file>
Hope this helps!
Thanks & Regards,
Prince Arora
已回答 4 年前
相關內容
- 已提問 1 年前
- 已提問 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前