Jenkins: what is the correct format for private key in Credentials

前端 未结 6 1728
难免孤独
难免孤独 2020-11-22 07:16

I\'m creating a job in Jenkins 2.152 running on Windows Server 2016 which needs to pull from a git repo hosted on bitbucket.org. I tested the ssh key through git-bash so I k

6条回答
  •  情深已故
    2020-11-22 08:04

    Check the version of Git for Windows that you are using: Starting 2.19.2, it comes with OpenSSH v7.9p1 (from 7.7 before)

    And... openssh 7.8 just changed the default ssh-keygen format, from a classic PEM 64-chars, to an OPENSSH one 70 chars!

    Only ssh-keygen -m PEM -t rsa -P "" -f afile would generate the old format (-m PEM)

    ssh-keygen(1):

    write OpenSSH format private keys by default instead of using OpenSSL's PEM format.

    The OpenSSH format, supported in OpenSSH releases since 2014 and described in the PROTOCOL.key file in the source distribution, offers substantially better protection against offline password guessing and supports key comments in private keys.
    If necessary, it is possible to write old PEM-style keys by adding "-m PEM" to ssh-keygen's arguments when generating or updating a key.

提交回复
热议问题