I am using java 8 with spring boot 2.2.3.RELEASE and following is my pom.xml for spring clould config server dependency

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Hoxton.SR1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

I have following as application.yml

server:
  port: 8888

spring:
  application:
      name: config-server
  cloud:
    config:
      server:
        git:
          uri: git@bitbucket.org:<myuserid>/config-repo.git

And my config server client have same spring boot and cloud dependency.

Bug report When I start the config client spring boot , I immediately see in config server console:

org.eclipse.jgit.api.errors.TransportException: git@bitbucket.org:<myuserid>c/config-repo.git: Auth fail
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:254) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]

Since i am using MacBook Pro MacOS Catalina 10.15.11 , I read this blog and had made sure to have rsa : I have all https://skryvets.com/blog/2019/05/27/solved-issue-spring-cloud-config-server-private-ssh-key/

Still I got Auth error. Any ideas?

Comment From: vmisra2018

Ok ,so I solved this issue by dpoingthese 4 steps

1) completely removing and deleting ~./ssh and regenerating ssh-rsa. 2)Then adding public key it to bitbucket 3)Then making sure we have this in ~/.ssh/config:

Host bitbucket.org User Hostname bitbucket.org AddKeysToAgent yes UseKeychain yes PreferredAuthentications publickey IdentitiesOnly yes IdentityFile ~/.ssh/ 4)Also making sure known_hosts is populated and regenerated by simply responding yes to ssh bitbucket.org

Comment From: somnathg-fullstack

@vmisra2018 your solution worked for me.

My .ssh/config is following:

Host bitbucket.org Hostname bitbucket.org AddKeysToAgent yes UseKeychain yes PreferredAuthentications publickey IdentitiesOnly yes IdentityFile ~/.ssh/

Also use https://stackoverflow.com/questions/53134212/invalid-privatekey-when-using-jsch steps to generate private key