Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on pushing to GitHub: SHA-1 Key #964

Open
sanjay-subskribe opened this issue Jan 27, 2024 · 6 comments
Open

Error on pushing to GitHub: SHA-1 Key #964

sanjay-subskribe opened this issue Jan 27, 2024 · 6 comments

Comments

@sanjay-subskribe
Copy link

While pushing branch to GitHub repo, which is cloned using SSH, it fails with below error:

You're using an RSA key with SHA-1, which is no longer allowed.

The same action works fine from terminal.

GitUp version: 1.3.5

image
@lucasderraugh
Copy link
Collaborator

lucasderraugh commented Jan 31, 2024

What key are you using to push to GitHub? The warning is valid and is what I'd expect if the keys being loaded in are for SHA-1. Are you sure you're loading your SSH keys correctly?

@sanjay-subskribe
Copy link
Author

I am not sure how the keys are loaded by GitUp.
My key seems to be correct. It is set up at ~/.ssh/id_rsa.pub. it is using SHA256 and 3072 bytes long.
The git commands works correctly from terminal.

@lucasderraugh
Copy link
Collaborator

lucasderraugh commented Mar 5, 2024

Have you looked at #35 for setting up the ssh key loading? Unfortunately our story for loading keys isn't great and needs some improvement, but there are some workarounds found there.

As an aside, GitHub recommends ed25519 be used rather than rsa.

So I would try first making sure the keys are being loaded by calling ssh-add --apple-use-keychain (optional -q for quiet mode), then launch GitUp and see if it works. If that doesn't work then you likely need to update your key, though I'm unsure why Terminal would work in that scenario.

@pertsevds
Copy link

I have the same problem.

I have an RSA key for old hosts that can't do modern crypto and ED25519 key for modern hosts.
In my ~/.ssh/config

Host github.com
  AddKeysToAgent yes
  UseKeychain yes
  UpdateHostKeys yes
  IdentityFile ~/.ssh/id_ed25519

I use ED25519 key as IdentityFile for Github, so SSH works in Terminal.
But when I try to fetch remote Github through GitUp it fails with this message You're using an RSA key with SHA-1, which is no longer allowed.

ssh-add --apple-use-keychain does not help.

How can I help to fix this issue.
AFAICS, this might be a libssh2 issue.

@pertsevds
Copy link

As a workaround
ssh-add -d ~/.ssh/id_rsa
did the trick.

@sanjay-subskribe
Copy link
Author

I tried a few things, but this is not working for me!

  1. I deleted ~/.ssh/id_rsa.pub. Terminal git push failed complaining Permission denied(publickey), but gitup gave the same error as shown in the screenshot above.
  2. I updated /etc/ssh/ssh_config and specified a different location of ssh key for github.com. that worked for command line, but gitup continued to show the same error.
  3. Tried ssh-add -d ~/.ssh/id_rsa. that also didnt work!

Any way, I am giving up now. Not gitup 😄 , just that I will use command line for git push!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants