Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services AWS,使用ec2 ssh失败_Amazon Web Services_Ssh_Amazon Ec2 - Fatal编程技术网

Amazon web services AWS,使用ec2 ssh失败

Amazon web services AWS,使用ec2 ssh失败,amazon-web-services,ssh,amazon-ec2,Amazon Web Services,Ssh,Amazon Ec2,我安装了instagram ec2 ssh实用程序,如下所述: ec2主机运行良好,并列出了主机。例如: legolas ec2-xx.xx.xx.xx.us-west-1.compute.amazonaws.com 但是,当我尝试通过名称登录时,会出现一个错误: [root@ip-xx.xx.xx.xx ec2-user]# ec2-ssh legolas Connecting to send: 'POST / HTTP/1.1\r\nAccept-Encoding: identity\r\

我安装了instagram ec2 ssh实用程序,如下所述:

ec2主机
运行良好,并列出了主机。例如:

legolas ec2-xx.xx.xx.xx.us-west-1.compute.amazonaws.com
但是,当我尝试通过名称登录时,会出现一个错误:

[root@ip-xx.xx.xx.xx ec2-user]# ec2-ssh legolas
Connecting to send: 'POST / HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 93\r\nUser-Agent: Boto/2.35.1 Python/2.6.9 Linux/3.14.27-25.47.amzn1.x86_64\r\nHost: ec2.us-west-1.amazonaws.com\r\nX-Amz-Date: 20150216T182656Z\r\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\r\nAuthorization: AWS4-HMAC-SHA256 Credential=AKIAxxx/20150216/us-west-1/ec2/aws4_request,SignedHeaders=host;x-amz-date,Signature=xxx\r\n\r\n'
send: 'Action=DescribeInstances&Filter.1.Name=tag%3AName&Filter.1.Value.1=legolas&Version=2014-10-01'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: text/xml;charset=UTF-8
header: Transfer-Encoding: chunked
header: Vary: Accept-Encoding
header: Date: Mon, 16 Feb 2015 18:26:55 GMT
header: Server: AmazonEC2
ec2-xx.xx.xx.xx.us-west-1.compute.amazonaws.com.
ssh: Could not resolve hostname send:: Name or service not known
sh: line 1: send:: command not found
sh: line 2: reply:: command not found
sh: line 3: header:: command not found
sh: line 4: header:: command not found
sh: line 5: header:: command not found
sh: line 6: header:: command not found
sh: line 7: header:: command not found
sh: line 8: ec2-xx.xx.xx.xx.us-west-1.compute.amazonaws.com: command not found

应在VPC上启用DNS解析。请按照以下步骤进行操作并重试

  • 右键单击AWS Web控制台上的VPC
  • 选择“编辑DNS解析”
  • 选择“是”单选按钮
  • 单击“保存”
  • 然后再次尝试ec2 ssh。应该行得通

  • 我想第一个明显的问题是:legolas是否有一个安全组,其传入端口22为SSH打开?@monkeymatrix-是的,如果我只是SSH到主机名,它就可以工作,就像SSH ec2一样-user@ec2-xx.xx.xx.xx.us-west-1.compute.amazonaws.comOk。看起来错误在于主机名无法解析。运行此操作的计算机上的端口53是否打开以允许它执行DNS查找?