# Troubleshooting Git SSH Clone Issues with Submodules on Different Hosts

**URL:** <https://community.okteto.com/t/troubleshooting-git-ssh-clone-issues-with-submodules-on-different-hosts/1272>\
**Category:** Help\
**Created:** [May 20, 2024, 9:47am UTC](https://community.okteto.com/t/troubleshooting-git-ssh-clone-issues-with-submodules-on-different-hosts/1272 "2024-05-20T09:47:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![provecho](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/provecho/32/45_2.png) [@provecho](https://community.okteto.com/u/provecho)\
**Post date:** [May 20, 2024, 9:47am UTC](https://community.okteto.com/t/troubleshooting-git-ssh-clone-issues-with-submodules-on-different-hosts/1272/1 "2024-05-20T09:47:45Z")

</div>

When cloning a Git repository that contains submodules from another server using SSH, I encounter an error:

```auto
Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

```

The repository is hosted on Server A, but it includes submodules cloned from Server B.

How can I resolve this issue?

---

<div class="post-metadata">

**Author:** ![provecho](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/provecho/32/45_2.png) [@provecho](https://community.okteto.com/u/provecho)\
**Post date:** [May 20, 2024, 9:49am UTC](https://community.okteto.com/t/troubleshooting-git-ssh-clone-issues-with-submodules-on-different-hosts/1272/2 "2024-05-20T09:49:04Z")

</div>

To overcome the host key verification failure when cloning a Git repository with submodules using SSH, you can override the installer’s `known_hosts` file by creating a custom Docker image.

Here are the steps to follow:

1. Create a new directory and navigate into it.

2. Create a `Dockerfile` in this directory with the following content:

3. Run the command below to generate and save the SSH host keys for your repository to a file named `known_hosts`:

4. Build the Docker image and push it to a container registry accessible by your Kubernetes cluster:

5. Update your Okteto self-hosted Helm release values with the following snippet and upgrade your installation:

By following these steps, you should be able to resolve the host key verification issue and successfully clone your Git repository with submodules using SSH.

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [October 13, 2025, 4:37pm UTC](https://community.okteto.com/t/troubleshooting-git-ssh-clone-issues-with-submodules-on-different-hosts/1272/3 "2025-10-13T16:37:32Z")

</div>

Starting on Okteto 1.37, you can now configure your `known_hosts` directly via the Okteto Admin UI. [You can learn more about this in our documentation.](https://www.okteto.com/docs/admin/ssh-known-hosts/)
