ssh “permissions are too open” error

2019-01-03 19:19发布

I had a problem with my mac where I couldn't save any kind of file on the disk anymore. I had to reboot OSX lion and reset the permissions on files and acls.

But now when I want to commit a repository I get the following error from 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.

What permissions levels should i give to the id_rsa file?

15条回答
虎瘦雄心在
2楼-- · 2019-01-03 19:23

for Win10 need move your key to user's home dir for linuxlike os you need to chmod to 700 like or 600 etc.

查看更多
闹够了就滚
3楼-- · 2019-01-03 19:24

what worked for me

chgrp Users FOLDER

chmod 600 FOLDER

查看更多
爷、活的狠高调
4楼-- · 2019-01-03 19:25

I am using VPC on EC2 and was getting the same error messages. I noticed I was using the public DNS. I changed that to the private DNS and vola!! it worked...

查看更多
看我几分像从前
5楼-- · 2019-01-03 19:31

Using Cygwin in Windows 8.1, there is a command need to be run:

chgrp Users ~/.ssh/id_rsa

Then the solution posted here can be applied, 400 or 600 is OK.

chmod 600 ~/.ssh/id_rsa

Ref: http://vineetgupta.com/blog/cygwin-permissions-bug-on-windows-8

查看更多
看我几分像从前
6楼-- · 2019-01-03 19:34

0600 is what mine is set at (and it's working)

查看更多
Emotional °昔
7楼-- · 2019-01-03 19:35

AFAIK the values are:

700 for the hidden directory ".ssh" where key file is located

600 for the keyfile "id_rsa"

查看更多
登录 后发表回答