创建EC2实例时,让AWS创建密钥,下载到本地Mac,然后chmod 400 my-key.pem
在当地航站楼:
ssh -i "my-key.pem" ubuntu@<public DNS>
The authenticity of host '<public DNS> (<public ip>)' can't be established.
ECDSA key fingerprint is SHA256:GO...4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '<public DNS>,<public ip>' (ECDSA) to the list of known hosts.
ssh_packet_read: Connection closed
$ssh -i "my-key.pem" ubuntu@<public DNS>
Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-92-generic x86_64)
...
ubuntu@ip-<private ip>:~$ls
ubuntu@ip-<private ip>:~$
我对发生的事感到困惑。首先,为什么无法建立主机的真实性,毕竟我在创建另一个实例时从AWS获得此密钥并使用相同的密钥连接到此实例,在创建此实例时,它被赋予相同的密钥对名称。
在对问题回答“是”时,究竟做了什么? 毕竟key是chmod到400,所以没有写访问权 什么是本地机器ssh和AWS之间发生的事情的高级描述? 感谢
答案 0 :(得分:0)
用onetick替换ubuntu:
ssh -i“ keyfile.pem” ubuntu @ [公共DNS]
至
ssh -i“ keyfile.pem” onetick @ [公共DNS]