SSH以弹性魔豆实例 [英] SSH to Elastic Beanstalk instance

查看:358
本文介绍了SSH以弹性魔豆实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚签署了亚马逊的新的弹性魔豆祭和热爱它。我无法弄清楚是如何SSH到青苗实例。我没有一个私钥,因为魔豆产生的实例代表我的。想法?

谢谢, 本诺

解决方案

我发现这是一个两步骤的过程。这是假设你已经设置了一个密钥来访问相关区域EC2实例。

配置安集团

  1. 在AWS控制台,打开EC2标签。
  2. 选择相关区域,然后单击安全组。
  3. 您应该有一个 elasticbeanstalk默认安全组,如果你已经在该地区推出了弹性青苗实例。
  4. 编辑安全组,以增加对SSH访问的规则。下面将锁定下来,只允许进入从一个特定的IP地址

      SSH | TCP | 22 | 22 | 192.168.1.1/32
     

配置您的弹性魔豆应用环境

  1. 如果您还没有作出一个密钥对的是,通过在EC2选项卡中点击下面的安全组密钥对做一个。
  2. 在AWS控制台,打开弹性魔豆标签。
  3. 选择相关区域。
  4. 在环境细节|编辑配置|实例
  5. 在EC2密钥对:,选择现有密钥对字段中输入密钥对的名称。

在该实例已重新启动,你需要从AWS控制台EC2实例选项卡中获取主机的名称,或通过API。然后,您应该能够ssh登录到服务器上。

  $的ssh -i路径/要/ keypair.pub ec2-user@ec2-an-ip-address.compute-1.amazonaws.com
 

请注意:要添加一个密钥对环境配置,实例终止保护必须关闭的青苗会设法终止当前的实例,并开始使用密钥对新的实例。

请注意:如果有什么不工作,检查魔豆应用程序/环境事件选项卡,并找出了问题。

I just signed up for Amazon's new Elastic Beanstalk offering and loving it. What I can't figure out is how to SSH to a Beanstalk instance. I don't have a private key because Beanstalk generated the instance on my behalf. Ideas?

Thanks, Benno

解决方案

I found it to be a 2-step process. This assumes that you've already set up a keypair to access EC2 instances in the relevant region.

Configure Security Group

  1. In the AWS console, open the EC2 tab.
  2. Select the relevant region and click on Security Group.
  3. You should have an elasticbeanstalk-default security group if you have launched an Elastic Beanstalk instance in that region.
  4. Edit the security group to add a rule for SSH access. The below will lock it down to only allow ingress from a specific IP address.

    SSH | tcp | 22 | 22 | 192.168.1.1/32
    

Configure the environment of your Elastic Beanstalk Application

  1. If you haven't made a key pair yet, make one by clicking Key Pairs below Security Group in the ec2 tab.
  2. In the AWS console, open the Elastic Beanstalk tab.
  3. Select the relevant region.
  4. Environment Details | Edit Configuration | Instances
  5. Under "EC2 key pair:", select the name of your keypair in the Existing Key Pair field.

Once the instance has relaunched, you need to get the host name from the AWS Console EC2 instances tab, or via the API. You should then be able to ssh onto the server.

$ ssh -i path/to/keypair.pub ec2-user@ec2-an-ip-address.compute-1.amazonaws.com

Note: For adding a keypair to the environment configuration, the instances' termination protection must be off as Beanstalk would try to terminate the current instances and start new instances with the KeyPair.

Note: If something is not working, check the "Events" tab in the Beanstalk application / environments and find out what went wrong.

这篇关于SSH以弹性魔豆实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆