vendir icon indicating copy to clipboard operation
vendir copied to clipboard

OpenSSH-generated private keys do not work in App CR

Open bcdurden opened this issue 2 years ago • 3 comments

When creating an App object using a ssh-git source and ssh private key, if the key was generated using openssh (default on MacOS as of this date) then it will fail complaining of key formatting.

usefulErrorMessage: "Error: Syncing directory '0': Syncing directory '.' with git
    contents: Fetching git repository: Git [fetch origin]: exit status 128 (stderr:
    Failed to add the host to the list of known hosts (/home/kapp-controller/.ssh/known_hosts).\r\nLoad
    key \"/etc/kappctrl-mem-tmp/kapp-controller-fetch-template-deploy420243064/.vendir-tmp/incoming/git-auth/private-key\":
    invalid format\r\[email protected]: Permission denied (publickey).\r\nfatal: Could
    not read from remote repository.\n\nPlease make sure you have the correct access
    rights\nand the repository exists.\n)\n"

bcdurden avatar Feb 24 '22 16:02 bcdurden

What are the headers of your private key? Like -----BEGIN OPENSSH PRIVATE KEY----- or what?

A repro of this would be helpful.

benmoss avatar Feb 24 '22 16:02 benmoss

Ah, I see the thread on Slack mentions that it is -----BEGIN OPENSSH PRIVATE KEY----- and that appears to be the problem

benmoss avatar Feb 24 '22 17:02 benmoss

Yes, sorry I should have been more specific. That header is specifically what triggers it I believe. When I switched to something with -----BEGIN RSA PRIVATE KEY----- it worked

bcdurden avatar Feb 25 '22 16:02 bcdurden