Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab: cannot create ssh key

Tags:

git

gitlab

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?

like image 512
zackzulg Avatar asked Sep 03 '26 09:09

zackzulg


1 Answers

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.

like image 55
VonC Avatar answered Sep 06 '26 00:09

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!