我从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文件什么权限?
当前回答
我尝试了对我的私钥进行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上,cygwin的chmod和chgrp对我来说还不够
右键单击文件->财产->安全性(选项卡)并删除除我的活动用户之外的所有用户和组。
我在EC2上使用VPC,并收到相同的错误消息。我注意到我在使用公共DNS。我把它改成了专用DNS和vola!!它奏效了。。。
另一个技巧是在下载文件夹中执行此操作。从AWS EC2实例下载私钥后,文件将位于该文件夹中,然后只需键入命令
ssh-keygen -y -f myprivateKey.pem > mypublicKey.pub
对于我(使用Windows的Ubuntu子系统),错误消息更改为:
Permissions 0555 for 'key.pem' are too open
在使用chmod 400之后。事实证明,使用root作为默认用户是原因。
使用cmd:
ubuntu config --default-user your_username
提供400许可,执行以下命令
chmod 400 /Users/username/.ssh/id_rsa