[SOLVED] Illegal base64 data in ssh key for private git repo artifact

Hey all, I’m trying to pull from a private repo with the artifact block in my job description:

artifact {
  source      = "git@github.com:my/private/git/file.txt"
  destination = "local/repo"
  options {
    sshkey = "somelongstringofcharactersoutputedbybase64command=(base)"

I understand that the key must be converted to base64, which I had done (with base64 -w0 ), which resulted in an output of a long string similar to above, ending in ‘=(base)’. I have tried including and removing the ‘=(base)’ portion of the string but I haven’t had any luck with either. What simple thing am I missing?

Maybe I should add that the key I’m using is from the id_rsa.pub file found on my machine converted with the previously mentioned command. Do I need some other specific type of key? I don’t know much about keys.

EDIT: I figured it out. It was due to missing the “=” sign at the end of the key. So the key, when using the command, should look something like:
you want to feed in everything up to and including the equals sign:

ALSO, I had to use the private key, not the public key. This is the id_rsa file and not the id_rsa.pub file.

Silly mistake, I’ll leave this up in case another noobie gets stuck.

EDIT 2: It looks like the mysterious (base) that was being appended to the end of the key came from the terminal not moving to the next line, and the (base) was actually from Anaconda’s ‘base’ environment that was being loaded. Probably just a me problem, but others with Anaconda installed might have the same issue.

To access the registry you need the private key, the public part is which has to be added to the user’s ssh keys which is accessing the git repo.

Ah. Well, I definitely feel silly. I’ll do some research on that… thank you a bunch!

Got it, I was leaving out the “=” sign in the key… more info has been edited into the original post. Thanks a bunch for your response!

in the shell, to be sure of what cryptic strings are, what I do is:

Z=$(echo -n "yadayada" | base64 -w0)
echo "[$Z]"

So, I know exactly what the string is.
HTH! :slight_smile: