[英]how to fix the error while im trying to connect private ec2 instance through public ec2 instance?
I'm creating 2 amazon elastic cloud compute instances one is public and one is pvt. 我正在创建2个亚马逊弹性云计算实例,一个是公共的,另一个是pvt。
How can I access the private instance through public instance? 如何通过公共实例访问私有实例?
What are the commands to execute? 要执行什么命令? I've tried with
我尝试过
ssh -p port number public-host name private-host name
I got the error as access denied 由于访问被拒绝,我得到了错误
It appears that your situation is: 看来您的情况是:
You will need to use the standard SSH command: 您将需要使用标准的SSH命令:
ssh -i pemfile.pem ec2-user@PRIVATE-IP-ADDRESS
Some things to note: 注意事项:
There are two ways to provide the pem file: 提供pem文件有两种方法:
Also, it depends on whether you are using the same key or a different key on the private computer. 此外,这取决于您在私人计算机上使用的是相同的密钥还是不同的密钥。 The easiest is to use the same key, which makes Agent Forwarding easier.
最简单的方法是使用相同的密钥,这使代理转发更加容易。
See: Securely Connect to Linux Instances Running in a Private Amazon VPC | 请参阅: 安全连接到在私有Amazon VPC中运行的Linux实例| AWS Security Blog
AWS安全博客
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.