gitkraren SSH key file format is invalid

SSH key file format is invalid - Git Integration for Jira Self Managed (gitkraken.com)

Git Integration for Jira application SSH keys:

  1. Must not be created using the OpenSSH format
  2. Must be the private SSH key
  3. Must use the supported certificate format: RSA
  4. Must use the supported storage format: OpenSSL PEM

Diagnosis

Jira admins will see a message similar to the one below when adding the SSH key:

The key format is invalid. Please check your private key.

Full error (stack trace) available in the Manage Git Repositories wizard or in Jira logs /application-logs/atlassian-jira.log:

Error:

com.bigbrassband.jira.git.exceptions.repository.InvalidPrivateKeyException: Private SSH key is invalid or empty
    at com.bigbrassband.jira.git.services.ssh.KeyManagerImpl.needPassphrase(KeyManagerImpl.java:103)
    at com.bigbrassband.jira.git.rest.wizard.WizardResource.validateRepoOrigin(WizardResource.java:104)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    ...
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
Caused by: com.jcraft.jsch.JSchException: invalid privatekey: [C@17h421rm
    at com.jcraft.jsch.KeyPair.load(KeyPair.java:664)
    at com.bigbrassband.jira.git.services.ssh.KeyManagerImpl.needPassphrase(KeyManagerImpl.java:99)
    ... 264 more

Cause

Jira admin has provided an SSH public key or an SSH private key with an incorrect format.

Solutions

  1. Create a new SSH key:

    On Linux and macOS:

    Use the following command to create a certificate:

    ssh-keygen -t rsa -b 4096 -m pem -C [your_email@example.com](mailto:your_email@example.com)

    MacOS often incorrectly creates an OpenSSH format certificate. For more details, see information on this common problem.

    On Windows:

    Download PuTTY and use PuTTYgen to generate an SSH key pair:

    1. Set Type of key… to RSA.

    2. Set Number of bits… to 4096.

    3. Click Generate. Move mouse pointer on the blank area as instructed.

    4. Follow screen instructions such as moving your mouse pointer on random locations on the blank area of the PuTTYgen dialog. Do this until the progress bar completely fills up and the SSH key pair is generated.

    5. Entering a Passphrase for the generated key is optional but will ensure a more secure connection.

    6. Save your generated public and private key to a file by clicking the respective options.

    7. Copy the generated key. This is the public key that you will be using on the SSH configuration page of your git host.

    8. For the private key, PuTTY creates a private key in its own “.ppk” format. Convert it to “.pem” via menu Conversions > Export OpenSSH key in PuTTYgen. Add/upload this file to Git Integration for Jira app > SSH Keys or when prompted on connecting SSH git repositories in Jira.

  2. Create a new SSH key using RSA certificate format. See Solution #1.

  3. Use OpenSSL PEM storage format. See Solution #1.

  4. Provide the public SSH key to the SSH configuration of your git host.

  5. Provide the private SSH key to the Git Integration for Jira app ➜ SSH Keys or when prompted on connecting SSH git repositories in Jira.

  • 29
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值