我从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文件什么权限?


当前回答

0600是我的设定值(并且正在工作)

其他回答

什么对我有用

chgrp用户文件夹chmod 600折叠

0600是我的设定值(并且正在工作)

我用sudo成功了

sudo chmod 400 pem-file.pem
sudo ssh -i pem-file.pem username@X.X.X.X

在Windows 10上,cygwin的chmod和chgrp对我来说还不够

右键单击文件->财产->安全性(选项卡)并删除除我的活动用户之外的所有用户和组。

提供400许可,执行以下命令

chmod 400 /Users/username/.ssh/id_rsa