0

I am trying to setup a Spring Cloud Config Server to track a private remote repository hosted on Github. I have setup my application.yaml file to use an ssh key to clone the repo:

server:
  port: 8888

spring:
  cloud:
    config:
      server:
        git:
          uri: git@github.com:my_username/my-repo.git
          clone-on-start: true
          ignore-local-ssh-settings: true
          host-key: my_rsa_public_key
          host-key-algorithm: ssh-rsa
          private-key: |
            -----BEGIN RSA PRIVATE KEY-----
                        ...
            -----END RSA PRIVATE KEY-----

I have generated the keys following the official Spring Cloud tutorial like so:

ssh-keygen -m PEM -t rsa -b 4096 -f ~/config_server_deploy_key.rsa

However, this setup fails with the following error:

Caused by: com.jcraft.jsch.JSchException: HostKey has been changed: github.com

When I try to set strict-host-key-checking: false in my application.yaml, it fails with the following error:

Caused by: com.jcraft.jsch.JSchException: Auth fail

I have tried several suggested solutions from related questions, such as this one and this one, but none of them worked in my case. I know that connecting to a private repository is challenging, but there certainly should be a way to do that. Is there anything I am missing?

0 Answers0