[英]Cannot connect to EC2 Instance either SSH or EC2 Instance
是的,ssh 中的所有问题都在实例内部的用户名中,因此请按照以下步骤解决您的问题:
go 到 ec2 仪表板并检查实例内的用户名是什么。
与实例建立新连接并从 ec2 仪表板下载新文件“.pem”。
使用以下路径在本地计算机中创建新文件并将其命名为“config”:
~/.ssh/config
- 在你的配置文件中写下这段代码
# Enter the alias of the ECS instance to connect to the instance by using an SSH key pair.
Host ec2
#Enter the public IP address of the instance.
HostName <public IP>
#Enter the port number. The default port number is 22.
Port 22
#Enter the logon account.
User <put the user name you found in your instance>
#Enter the address of the .pem private key file on your PC.
IdentityFile <~/Desktop/myservice.pem>
- 如果你想 ssh 它只是这样做
ssh ec2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.