简体   繁体   中英

Gitlab: cannot create ssh key

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM