我从ssh收到以下错误:
Permissions 0777 for '/Users/username/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
我应该授予id_rsa文件什么权限?
我从ssh收到以下错误:
Permissions 0777 for '/Users/username/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
我应该授予id_rsa文件什么权限?
当前回答
在我的案例中,问题是空白太多。
ssh -i mykey.pem ubuntu@instace.eu-north-1.compute.amazonaws.com
but
ssh -i mykey.pem ubuntu@instace.eu-north-1.compute.amazonaws.com
工作正常。问题是空白被视为用户名的一部分。
其他回答
我用sudo成功了
sudo chmod 400 pem-file.pem
sudo ssh -i pem-file.pem username@X.X.X.X
我在玩Ansible时遇到了这个错误。为了解决这个问题,我已将私钥的权限更改为600。而且成功了!
chmod 600 .vagrant/machines/default/virtualbox/private_key
在我的案例中,问题是空白太多。
ssh -i mykey.pem ubuntu@instace.eu-north-1.compute.amazonaws.com
but
ssh -i mykey.pem ubuntu@instace.eu-north-1.compute.amazonaws.com
工作正常。问题是空白被视为用户名的一部分。
另一个技巧是在下载文件夹中执行此操作。从AWS EC2实例下载私钥后,文件将位于该文件夹中,然后只需键入命令
ssh-keygen -y -f myprivateKey.pem > mypublicKey.pub
除了公认的答案之外,如果您已经完成了所有建议的方法,并且在windows上使用了“wsl”ubuntu,那么可以在ssh命令中附加“sudo”,例如
sudo ssh-i xxx.pemxxxx@xxxx.compute-1.amazonaws.com