每次重新启动后,ssh密钥文件无保护的私钥文件错误 [英] ssh key file unprotected private key file error every time after reboot
问题描述
我有一个奇怪的问题,每次我重新启动Mac
之后,在尝试使用capistrano进行部署时都会收到以下错误消息
I have a weird problem where every time after I reboot my Mac I get the following error while trying to deploy using capistrano
'/ Users / guy / .ssh / id_rsa.pub'的权限0644太开放了
Permissions 0644 for '/Users/guy/.ssh/id_rsa.pub' are too open
我不记得了我上次如何解决这个问题。我只是记得那很烦人,还发生了计算机重新启动。
I don't remember how I fixed this last time. I just remember it was annoying and also happened a reboot to the computer.
我对id_rsa文件的许可为600
,对于id_rsa.pub的许可为644
my permission for the id_rsa file are 600 and for the id_rsa.pub are 644
如果我运行 chmod 600 id_rsa
在使用capistrano进行部署时,它将要求输入密码。
一个我不知道的密码...
then it will ask for a password while deploying with capistrano. a password which I don't know...
我们将不胜感激。谢谢
推荐答案
您需要确保ssh密钥的所有父文件夹都不可用于组或其他文件夹。
You need to make sure that all the parent folders of your ssh keys are not writable for group or other.
例如:755或更严格(在任何地方都不是775)
For instance: 755 or stricter (not 775 anywhere)
这是针对:
-
/ Users
-
/ Users /家伙
-
/Users/guy/.ssh
/Users
/Users/guy
/Users/guy/.ssh
当SSH私钥权限设置为0600时,出现 密码对话框问题。包含了很多好的建议,包括OP遵循的建议:
The question "Password dialog appears when SSH private key permissions are set to 0600" includes a lot of good advices, including one that the OP followed:
当我有
id_rsa
,但没有相应的id_rsa.pub
,Mac OS X不断弹出对话框,并记住我的钥匙串中的密码没有任何作用。
When I had an
id_rsa
but not a correspondingid_rsa.pub
, Mac OS X kept popping up the dialog and remember password in my keychain did nothing.
cd ~/.ssh
ssh-keygen -y -f id_rsa > id_rsa.pub
为我生成了适当的公钥文件。
generated the appropriate public key file for me.
因此重新生成可以提供帮助。
So re-generating can help.
这篇关于每次重新启动后,ssh密钥文件无保护的私钥文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!