One - One Code All

Blog Content

阿里云ECS重装系统后ssh .pem免密登陆

Linux-Mac   2018-03-25 11:11:03


获取.pem文件

左侧菜单 选择 密钥对

创建密钥对 -> 自动下载获得 .pem

绑定密钥对

重启EC2机器



客户端登陆阿里云linux(mac)

ssh -i xxx.pem root@ip


遇见问题:

Please contact your system administrator.

Add correct host key in  .ssh/known_hosts to get rid of this message.

Offending ED25519 key in .ssh/known_hosts:9

Host key verification failed.


原因:A的known_hosts文件中记录的B的公钥1 与 连接时B传过来的公钥2不匹配

解决方法:删除A的known_hosts文件中记录的B的公钥(手动进行,不适用于自动化部署情形)




上一篇:iTerm2固定标签名字
下一篇:修改Mac终端(Terminal)的提示文字

The minute you think of giving up, think of the reason why you held on so long.