帮助访问 Amazon EC2 实例
尝试使用 osx 10.6 为简单(当前)php 应用程序设置第一个 EC2 实例。当我尝试在命令行中访问我的新实例时,我只能得到 ssh: connect to host xx.xxx.xxx.xxx port 22: Operation timed out
。
我在命令行中输入:
ssh -i <MYPEMNAME>.pem ec2-user@<PRIVATEIP/PUBLICDNS/ELASTICIP>
我在管理控制台中将其作为安全规则:
rule name: web_access
22(SSH) 0.0.0.0
80(HTTP) 0.0.0.0
我完全打开了 ssh 只是为了测试它,当它工作时我会得到一个更合适的 ip。
我创建了一个弹性 IP,这是我在“ec2-user@...”之后尝试的一个选项,
当我创建实例时,我还生成了一个 .pem,该实例已保存到我的计算机上的文件夹 .ec2 中,命名为中引用的.pem 上面。
管理控制台显示实例正在运行。我认为我此时 ssh 访问错误。
非常感谢任何帮助! 谢谢
Trying to set up first EC2 instance for simple (currently) php app, using osx 10.6. When i try to access my new instance in the command line i can only get ssh: connect to host xx.xxx.xxx.xxx port 22: Operation timed out
.
i'm typing this at command line:
ssh -i <MYPEMNAME>.pem ec2-user@<PRIVATEIP/PUBLICDNS/ELASTICIP>
i have this as a security rule in the management console:
rule name: web_access
22(SSH) 0.0.0.0
80(HTTP) 0.0.0.0
i have ssh completely open just to test this, i'll get a more appropriate ip when it works.
i created an elastic IP, which was one option i tried after 'ec2-user@...'
i also generated a .pem when i created the instance which i have saved to a folder .ec2 on my machine, named as referenced in .pem above.
the management console says the instance is running. i think im just doing the ssh access wrong at this point.
any help tremendously appreciated!
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,评论很正确。这是一个 ssh 问题,主要是我试图添加一个允许 ssh 的自定义安全规则,但默认情况下不允许。不管出于什么原因,自定义规则没有被应用,所以我只是编辑了默认规则以允许端口 22 (ssh),并且我几乎已经启动并运行了。还需要运行 chmod。 !! Anddd,如果您像我一样添加新的密钥对,您可能需要进入 ssh/known_hosts 文件并删除对旧密钥对的引用。由于中间人攻击的错误,我被挂了一段时间。
谢谢
Yeah, comments were pretty correct. It was an ssh issue and the main thing was that i was trying to add a custom security rule that allowed ssh but the default didn't. and for whatever reason the custom rule wasn't being applied so i just edited the default rule to allow port 22 (ssh) and I was pretty much up and running. Also needed to run chmod. !! Anddd, if you add a new keypair like I did, you may need to go into the ssh/known_hosts file and delete reference to your old keypair. that was hanging me up for a while with a an error out a middleman attack.
thanks