error checking for new versions: private keys with passphrases are not supported. ssh-keygen

在配置 concourse ci 从 git 仓库 pull 代码时 遇到的错误

run check step: run check step: check: resource script '/opt/resource/check []' failed: exit status 1

stderr:
error checking for new versions: private keys with passphrases are not supported

错误提示很明显,private keys with passphrases are not supported,是因为使用的 private key 有问题。重新生成一个即可

当前私钥生成

$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# Start the SSH key creation process
> Enter file in which the key is (/Users/you/.ssh/id_rsa): [Hit enter]
> Key has comment '/Users/you/.ssh/id_rsa'
> Enter new passphrase (empty for no passphrase): [Type new passphrase]
> Enter same passphrase again: [One more time for luck]
> Your identification has been saved with the new passphrase.

私钥格式

-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn
...
-----END OPENSSH PRIVATE KEY-----

我们期望得到的私钥格式

-----BEGIN RSA PRIVATE KEY-----
MIIJKQIBAAKCAgEAoO4L2bGUELgYJkBSRHlJTpaLV0sG2NIVhuElsTyPSAV5JNXn
...
-----END RSA PRIVATE KEY-----

命令中增加 -m PEM

ssh-keygen -m PEM -t rsa -b 4096 -C "your_email@example.com"

https://serverfault.com/questions/939909/ssh-keygen-does-not-create-rsa-private-key