如何为Amazon EC2实例设置SSH访问? [英] How do I set up SSH access for an Amazon EC2 instance?

查看:610
本文介绍了如何为Amazon EC2实例设置SSH访问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过SSH访问运行Ubuntu 10.4的Amazon EC2实例。我所拥有的只是Amazon用户名和密码。有任何想法吗?

I need SSH access to an Amazon EC2 instance running Ubuntu 10.4. All I have is the Amazon username and password. Any ideas?

推荐答案

基本上,您需要一个私钥文件才能通过SSH登录到EC2。请按照以下步骤创建一个:

Basically, you need a private-key file to login into your EC2 via SSH. Follow these steps to create one:


  • 转到 https://console.aws.amazon.com/ec2/home &登录到您现有的Amazon帐户。

  • 单击LHS上的密钥对或 https://console.aws.amazon.com/ec2/home?region=us-east-1#s=KeyPairs

    • 您应该看到由您生成的密钥列表(或在EC2创建过程中)。

    • 单击创建密钥对如果您看不到任何密码或丢失了私钥。

    • 输入唯一的名称,然后按Enter。

    • 将出现下载面板为您保存私钥,请将其保存。

    • 将其保留在文件权限为 0600的某个地方

    • Go https://console.aws.amazon.com/ec2/home & sign in to your existing Amazon account.
    • Click on "Key Pairs" on LHS or https://console.aws.amazon.com/ec2/home?region=us-east-1#s=KeyPairs.
      • You should see the list of KEYs generated by you (or during EC2 creation process).
      • Click on "Create Key Pair" if you don't see any or you lost your private-key.
      • Enter a unique name and hit enter.
      • A download panel will appear for you to save the private-key, save it.
      • Keep it somewhere with the file permission "0600"

      • 您应该看到ec2的列表-实例,如果看不到,请创建一个。

      • 单击EC2计算机并记下公共DNS地址。


      • ssh -i / path / to / private-key root @< ec2-public-dns-address> -根用户名具有为了避免在最新版本中使用,请根据您的分布选择 ec2-user ubuntu 作为用户名。

      • 点击Enter

      • 就是这样。

      • ssh -i /path/to/private-key root@<ec2-public-dns-address> - the root username has been avoided in the latest releases, based on your distribution select ec2-user or ubuntu as your username.
      • hit Enter
      • That's it.

      这篇关于如何为Amazon EC2实例设置SSH访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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