我从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文件什么权限?
当前回答
在我的例子中,我试图从Windows 10中的Ubuntu应用程序连接,并得到了上面的错误。通过在实际命令之前在Ubuntu控制台中运行sudo-su,可以在没有任何权限更改的情况下解决该问题
其他回答
我正在使用Windows 10,并尝试通过SSH连接到EC2实例。不要使用Cygwin for Windows,而是尝试使用Git Bash。在为密钥执行chmod 400之后,我可以通过SSH连接到EC2实例,但从Cygwin看,这一点不适用。Windows将.pem文件视为来自internet并阻止它,即使禁用继承也不起作用。
我将文件转换为.ppk格式,PuTTY也能正常工作,但Cygwin无法正常工作。
700 folder
644 id_rsa.pub
这对我有用。
我从另一台mac迁移后也遇到了同样的问题。它被我的钥匙阻止连接github。
我重置了如下权限,现在运行良好。
chmod 700 ~/.ssh # (drwx------)
cd ~/.ssh
chmod 644 *.pub # (-rw-r--r--)
chmod 600 id_rsa # (-rw-------)
对于我(使用Windows的Ubuntu子系统),错误消息更改为:
Permissions 0555 for 'key.pem' are too open
在使用chmod 400之后。事实证明,使用root作为默认用户是原因。
使用cmd:
ubuntu config --default-user your_username
在连接到AWS实例时,我在Windows上的WSL上遇到了这个问题。通过切换到经典的命令提示符,我的问题得到了解决。您可以尝试切换到不同的终端接口,看看这是否有帮助。