简体   繁体   English

Gitlab:无法创建 ssh 密钥

[英]Gitlab: cannot create ssh key

I have this error when I add ssh-rsa key:添加 ssh-rsa 密钥时出现此错误:

The form contains the following error: Key must be at least 4096 bits表单包含以下错误:密钥必须至少为 4096 位

To generate ssh-key (private and public) I execute ssh-keygen要生成 ssh-key(私有和公共),我执行 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.如果需要将公钥复制到 GitLab,请使用~/.ssh/gitlab.pub文件内容。

To test it, create a ~/.ssh/config file with:要对其进行测试,请使用以下命令创建一个 ~/.ssh/config 文件:

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.ssh -Tv gitlab检查您是否收到欢迎消息,确认您已正确通过身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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