Unable to clone with SSH: unprotected private key file
See original GitHub issueDescribe the bug
When attempting to clone a git repository via the terminal, I get the error:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/etc/ssh/default-1569588924848/ssh-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 "/etc/ssh/default-1569588924848/ssh-privatekey": bad permissions
Permission denied (publickey).
fatal: Could not read from remote repository.
I can’t change the permissions as Che is injecting this as readonly.
Che version
- latest
- nightly
- other: please specify
Steps to reproduce
- Add SSH key with the
SSH: generate key pair...
command - Restart workspace
- Launch terminal for main workspace container
- Run
git clone {some git@ URL}
Expected behavior
SSH key should be mounted with appropriate permissions (i.e. 400
or 600
).
Runtime
- kubernetes (include output of
kubectl version
) - Openshift (include output of
oc version
) - minikube (include output of
minikube version
andkubectl version
) - minishift (include output of
minishift version
andoc version
) - docker-desktop + K8S (include output of
docker version
andkubectl version
) - other: Rancher
kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.9", GitCommit:"3e4f6a92de5f259ef313ad876bb008897f6a98f0", GitTreeState:"clean", BuildDate:"2019-08-05T09:22:00Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.6", GitCommit:"96fac5cd13a5dc064f7d9f4f23030a6aeface6cc", GitTreeState:"clean", BuildDate:"2019-08-19T11:05:16Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Installation method
Helm charts via Rancher
Environment
- my computer
- Windows
- Linux
- macOS
- Cloud
- Amazon
- Azure
- GCE
- other (please specify)
- other: please specify
Issue Analytics
- State:
- Created 4 years ago
- Comments:41 (40 by maintainers)
Top Results From Across the Web
Getting "Warning: unprotected private key file!" error message ...
It works. I have 10 servers, i copied the id_rsa from server1 to all other 9 servers then i got this error. To...
Read more >Fixing UNPROTECTED PRIVATE KEY FILE.md - Github-Gist
If you are getting this error then you probably reset the permissions on your hidden .ssh directory in your user folder, and your...
Read more >How to Fix SSH “Permission Denied” with Git Clone - Medium
First of all, ensure that your SSH key has been generated and the file containing the corresponding public key id_rsa.pub has been added...
Read more >UNPROTECTED PRIVATE KEY FILE!” on Linux - How-To Geek
yes Failed to add the host to the list of known hosts (/home/geek/.ssh/known_hosts). This means that the permissions on that file are also...
Read more >After adding a Bitbucket repository Fisheye is unable to clone it
It's caused by the fact that the private ssh key generated has file permissions which ... Repository cloning fails because the private key...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vinokurig it worked!! Great job, I am now able to clone via SSH.
@vinokurig thank you very much, I can confirm that setting FS__GROUP to
NULL
allows the SSH key to work 😃