[英]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.