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

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

问题描述

我需要对运行 Ubuntu 10.4 的 Amazon EC2 实例进行 SSH 访问.我只有亚马逊用户名和密码.有什么想法吗?

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 &登录您现有的亚马逊帐户.
  • 点击 LHS 上的密钥对"或 https://console.aws.amazon.com/ec2/home?region=us-east-1#s=KeyPairs.
    • 您应该会看到您(或在 EC2 创建过程中)生成的 KEY 列表.
    • 如果您没有看到任何或丢失了您的私钥,请单击创建密钥对".
    • 输入一个唯一的名称并按回车键.
    • 将出现一个下载面板供您保存私钥,保存.
    • 使用文件权限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-instances 的列表,如果没有看到,请创建一个.
      • 点击 EC2 机器并记下公共 DNS 地址.
      • ssh -i/path/to/private-key root@<ec2-public-dns-address> - 根据您的发行版选择,最新版本中已避免使用 root 用户名ec2-userubuntu 作为您的用户名.
      • 按回车
      • 就是这样.
      • 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天全站免登陆