3

I have this error when I add ssh-rsa key:

The form contains the following error: Key must be at least 4096 bits

To generate ssh-key (private and public) I execute ssh-keygen

Any idea how to solve my problem?

3
  • 1
    Look at ssh-keygen's -b option to create bigger keys. Commented Jul 14, 2022 at 14:31
  • @barrycarter it doesn't work :( ssh-keygen -b option requires an argument -- b usage: ssh-keygen [-q] [-b bits] [-C comment] [-f output_keyfile] [-m format] [-N new_passphrase] [-t dsa | ecdsa | ed25519 | rsa] ssh-keygen -p [-f keyfile] [-m format] [-N new_passphrase] Commented Jul 14, 2022 at 15:24
  • 2
    Er, yes, I meant ssh-keygen -b 4096 or something-- I was suggesting you man ssh-keygen and look at the -b option Commented Jul 14, 2022 at 15:25

1 Answer 1

3

For testing, you can use a passphrase-less key with, while specifying the number of bits in the key to create:

 ssh-keygen -t rsa -b 4096 -P "" -f ~/.ssh/gitlab

If you need to copy the public key to GitLab, use the ~/.ssh/gitlab.pub file content.

To test it, create a ~/.ssh/config file with:

Host gitlab
  Hostname gitlab.com
  User git
  IdentityFile ~/.ssh/gitlab

And ssh -Tv gitlab to check if you get a Welcome message, confirming you are properly authenticated.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.