ssh“权限太开”错误

我遇到了一个问题,我无法在磁盘上保存任何类型的文件。 我不得不重新启动OSX狮子并重置文件和acls的权限。

但现在当我想提交一个仓库时,我从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文件什么权限级别?


密钥只能由您阅读:

chmod 400 ~/.ssh/id_rsa

600似乎也很好(实际上在大多数情况下更好,因为您不需要更改文件权限来编辑它)。

manpage中的相关部分( man ssh

 ~/.ssh/id_rsa
         Contains the private key for authentication.  These files contain sensitive 
         data and should be readable by the user but not
         accessible by others (read/write/execute).  ssh will simply ignore a private 
         key file if it is              
         accessible by others.  It is possible to specify a
         passphrase when generating the key which will be used to encrypt the sensitive 
         part of this file using 3DES.

 ~/.ssh/identity.pub
 ~/.ssh/id_dsa.pub
 ~/.ssh/id_ecdsa.pub
 ~/.ssh/id_rsa.pub
         Contains the public key for authentication.  These files are not sensitive and 
         can (but need not) be readable by anyone.

在Windows 8.1中使用Cygwin,需要运行一个命令:

chgrp用户〜/ .ssh / id_rsa

然后可以应用这里发布的解决方案,400或600是可以的。

chmod 600〜/ .ssh / id_rsa

参考:http://vineetgupta.com/blog/cygwin-permissions-bug-on-windows-8


在Windows 8.1上运行的独立于语言环境的解决方案是:

chgrp 545 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa

即使您的语言环境为用户使用了不同的字词,GID 545也是一个特殊的ID,它始终指向'用户'组。

链接地址: http://www.djcxy.com/p/14957.html

上一篇: ssh "permissions are too open" error

下一篇: Android permissions: How can I learn which are dangerous vs normal?