简体   繁体   English

ssh到Amazon EC2上的Ubuntu实例

[英]ssh to Ubuntu instance on Amazon EC2

I'm running Ubuntu instance on EC2 and I can't ssh to it. 我在EC2上运行Ubuntu实例,但无法对其进行SSH操作。 I get the following: 我得到以下内容:

Connection timed out

I don't know how to access it. 我不知道如何访问它。 I used the following: 我使用了以下内容:

ssh -i <key>.pem ubuntu@<instance address>

Any ideas? 有任何想法吗?

OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to ec2-54-235-7-137.compute-1.amazonaws.com [54.235.7.137] port 22. debug1: connect to address 54.235.7.137 port 22: Connection timed out ssh: connect to host ec2-54-235-7-137.compute-1.amazonaws.com port 22: Connection timed out

Double check that your instace_address if your public dns, it can change when you rebot. 仔细检查您的instace_address(如果您的公共dns是否可用),如果您进行重新设置,它可以更改。

Check that you have the correct permission set for .pem 检查您是否为.pem设置了正确的权限

Are you behind a proxy? 您是代理人吗? Like a work network? 像工作网络一样? This might require a corkscrew configuration. 这可能需要开瓶器配置。

Are you able to launch a Amazon Linux, and ssh using 您是否可以启动Amazon Linux,并使用ssh

ssh -i <key>.pem ec2-user@<instance_address>

Double check that ubuntu is the correct username for your instance(but to be honest I do think it is), but also try user, and ec2-user 仔细检查ubuntu是否是您实例的正确用户名(但老实说,我确实是这样),但还要尝试user和ec2-user

Set your security group to allow 0.0.0.0/0, are you able to get in now? 将您的安全组设置为允许0.0.0.0/0,您现在可以进入吗? Security group issue if so. 安全组问题,如果是这样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM