我想在不使用Windows上的.pem文件的情况下切换到EC2实例。
而不是使用
ssh -i /path/my-key-pair.pem ec2-user@public-dns-hostname
如documentation中所述,我想使用
ssh ec2-user@public-dns-hostname
我读到您需要更改.ssh目录的权限,但是对于Windows我该怎么做呢?
解决我的问题的最佳方法是什么?
谢谢:)
答案 0 :(得分:0)
您可以使用=
文件来完成此操作。例如:
~/.ssh/config
使用此配置,您只需执行Host ec2-ip-or-dns-name
User ec2-user
PreferredAuthentications publickey
Port 22
IdentityFile c:/path/to/my-ec2-key.pem
IdentitiesOnly yes
,而无需指定用户或ssh ec2-ip-or-dns-name
文件。