ssh-permissions-are-too-open解决方法

前几天跑S6的框架,然后在一个ssh的环节报错。

具体错误

1
2
3
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.

大概意思就是权限太松了。

解决方法

只需要将~/.ssh/id_rsa的权限调整为只有自己可读就好了。

众所周知,r=4为可读,w=2为可写,x=1为可执行。三个分别是usergroupother。权限位相或即可。

所以

1
2
3
chmod 400 ~/.ssh/id_rsa
#或者
chmod 600 ~/.ssh/id_rsa

参考资料

  • https://stackoverflow.com/questions/9270734/ssh-permissions-are-too-open-error