# 偶发性ssh拉取代码失败fatal: Could not read from remote repository

**URL:** <https://forum.gitea.com/t/ssh-fatal-could-not-read-from-remote-repository/11872>\
**Category:** 中文求助(Chinese Only)\
**Created:** [December 24, 2025, 9:10am UTC](https://forum.gitea.com/t/ssh-fatal-could-not-read-from-remote-repository/11872 "2025-12-24T09:10:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hcl](https://avatars.discourse-cdn.com/v4/letter/h/f04885/32.png) [@hcl](https://forum.gitea.com/u/hcl)\
**Post date:** [December 24, 2025, 9:10am UTC](https://forum.gitea.com/t/ssh-fatal-could-not-read-from-remote-repository/11872/1 "2025-12-24T09:10:28Z")

</div>

报错为

```auto
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Unable to fetch in submodule path 'basecore'

```

根据官网指示，git用户设置了可用的shell：/bin/bash，并且.ssh/authorized\_keys文件也是正常的，目前是使用的openresty的22端口（openresty的ssh端口改为了2222），将外网流量stream代理到gitea机器上的22端口，但是就是会出现偶发性的拉取失败。
