我从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文件什么权限?
这些键只能由您进行读写:
chmod 600 ~/.ssh/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 Users ~/.ssh/id_rsa
那么这里发布的解决方案可以应用,400或600都可以。
chmod 600 ~/.ssh/id_rsa
C:\ cygwin64
),因此它可能继承了权限。奇怪的是,在我拥有的其他笔记本电脑上没有发生这种情况。 - Zach Thackerchmod 600 ~/.ssh/id_rsa
。然后,运行ssl -L xxxx id_rsa。它会询问我主机'ci-smartface.westeurope.cloudapp.azure.com (13.94.213.109)'的真实性无法确定。
ECDSA密钥指纹为yyyy。您确定要继续连接吗(是/否)?我输入'yes',但仍然存在相同的错误:警告:未受保护的私钥文件! - us2956.pem
添加到myuser目录
来解决问题。 - Sam-T在AWS上,使用Windows 10通过ssh连接Ubuntu EC2时出现“权限过大”错误
我试着使用AWS的.pem文件连接Ubuntu EC2实例时遇到了这个问题。
在Windows中,当我将该密钥放入.ssh文件夹下创建的文件夹中时,它可以正常工作。
C:\Users\USERNAME\.ssh\private_key
更改 Windows 10 权限设置的方法:
文件设置 > 安全性 > 高级
禁用继承
将继承的权限转换为显式权限
删除除管理员外的所有权限条目
然后可以安全连接。
在 Windows 8.1 上可行的与语言环境无关的解决方案是:
chgrp 545 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
GID 545是一个特殊的ID,即使您的语言环境使用不同的单词表示“Users”组,它仍然指代“Users”组。
据我所知,这些值为:
700
用于隐藏目录.ssh
,其中包含密钥文件
600
用于密钥文件id_rsa
我的设置为0600(而且它能够正常工作)
当我试图使用公共密钥登录远程FTP服务器时,遇到了类似的问题。
为解决此问题,我执行了以下步骤:
600
。chmod 600 id_rsa
chmod
和chgrp
不够用。我必须右键单击文件 -> 属性 -> 安全(选项卡)并删除除了我的活动用户之外的所有用户和组。我用sudo
命令取得了成功。
sudo chmod 400 pem-file.pem
sudo ssh -i pem-file.pem username@X.X.X.X
chmod go-r id_rsa
。g
代表group
,o
代表others
,r
表示read
。不再出现奇怪的代码,意义才是王道。 - AlikElzin-kilaka