# Git clone via SSH proxy in Jenkins

**URL:** <https://community.jenkins.io/t/git-clone-via-ssh-proxy-in-jenkins/9264>\
**Category:** Using Jenkins\
**Created:** [August 29, 2023, 8:55am UTC](https://community.jenkins.io/t/git-clone-via-ssh-proxy-in-jenkins/9264 "2023-08-29T08:55:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spryffee](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/spryffee/32/5321_2.png) [@spryffee](https://community.jenkins.io/u/spryffee)\
**Post date:** [August 29, 2023, 8:55am UTC](https://community.jenkins.io/t/git-clone-via-ssh-proxy-in-jenkins/9264/1 "2023-08-29T08:55:01Z")

</div>

I’m looking for a proper way to git clone using ssh proxy in Jenkins for freestyle job.  
The problem is that the ssh key chosen on Source Code Management step is not used by build node when authentication on proxy host. Instead, it looks for local keys on the node.

```auto
stderr: user123@ssh-proxy.example.com: Permission denied (publickey).
kex_exchange_identification: Connection closed by remote host

```

.ssh/config on the build node

```auto
Host git.example.com
    ProxyJump ssh-proxy.example.com

Host ssh-proxy.example.com
    User user123

```

If I manually put the key on the node, it works. However this is not Jenkins way. Can anyone advice better approach to this?
