I’m trying to follow the guide for setting up ssh keys in docker but I’m getting the error:
Validation failed
Variables value is invalid
when copying over the private key.
I’m trying to follow the guide for setting up ssh keys in docker but I’m getting the error:
Validation failed
Variables value is invalid
when copying over the private key.
I’m seeing the same failure, and it completely blocks me from setting up CI!
Same issue here. Our CI is broken because of that. Is there another method to register an ssh key as a variable?
@dangirsh @dennis seems like the solution is to encode / decode base64 https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_15038961
For me, any variable entered in CI / CD Settings > Variables gives the failure:
Validation failed
Variables value is invalid
However, if I disable the “Masked” toggle, it goes through.
It seems that my issue is not specific to the name being SSH_PRIVATE_KEY
or the contents of the variable.
Ah, seems like private SSH keys don’t meet the requirements for masked variables: https://docs.gitlab.com/ee/ci/variables/#masked-variables
I’m pretty sure this worked in the past…
How can I do this?
Agreed, why cannot we hide a private SSH key ?
Ya whats up with this? There a numerous tutorials out there using masked variables to store private keys… is there a preferred way to deploy via SSH? Why can’t we make the variables private?
I have this set on a couple of repos.
Just today tried to set up the automatic deployment for a new project and it doesn’t work.
i solve this by encoding private key to base64, and in my yml file i add this
- echo "$PRIVATE_KEY" | base64 --decode > /root/.ssh/id_rsa
but it’s not masked