我从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文件什么权限?
当前回答
700 folder
644 id_rsa.pub
这对我有用。
其他回答
在Windows 8.1中使用Cygwin时,需要运行以下命令:
chgrp Users ~/.ssh/id_rsa
然后可以应用此处发布的解决方案,400或600即可。
chmod 600 ~/.ssh/id_rsa
此处引用
正如人们所说的,在Windows中,我只是将.pem文件放在C:\Users\[user]\.ssh\中,这就解决了问题。尽管您可以在bash或powershell提示符下执行chmod和其他命令行选项,但这些选项都不起作用。我没有改变rsa或其他任何东西。然后,在运行连接时,必须将pem文件的路径放在.ssh文件夹中:
ssh -i "C:\Users\[user]\.ssh\ubuntukp01.pem" ubuntu@ec[ipaddress].us-west-2.compute.amazonaws.com
我尝试了对我的私钥进行600级的权限,结果成功了。
chmod 600 privateKey
[dev]$ ssh -i privateKey user@ip
另一方面
chmod 755 privateKey
[dev]$ ssh -i privateKey user@ip
给出以下问题:
Permissions 0755 for 'privateKey' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "privateKey": bad permissions
我正在使用Windows 10,并尝试通过SSH连接到EC2实例。不要使用Cygwin for Windows,而是尝试使用Git Bash。在为密钥执行chmod 400之后,我可以通过SSH连接到EC2实例,但从Cygwin看,这一点不适用。Windows将.pem文件视为来自internet并阻止它,即使禁用继承也不起作用。
我将文件转换为.ppk格式,PuTTY也能正常工作,但Cygwin无法正常工作。
在我的案例中,问题是空白太多。
ssh -i mykey.pem ubuntu@instace.eu-north-1.compute.amazonaws.com
but
ssh -i mykey.pem ubuntu@instace.eu-north-1.compute.amazonaws.com
工作正常。问题是空白被视为用户名的一部分。