# Clone via ssh only working with full repo path

**URL:** <https://forum.gitea.com/t/clone-via-ssh-only-working-with-full-repo-path/9714>\
**Category:** Install/Maintain/Configure\
**Created:** [September 12, 2024, 9:47pm UTC](https://forum.gitea.com/t/clone-via-ssh-only-working-with-full-repo-path/9714 "2024-09-12T21:47:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmiku](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/tmiku/32/6249_2.png) [@tmiku](https://forum.gitea.com/u/tmiku)\
**Post date:** [September 12, 2024, 9:47pm UTC](https://forum.gitea.com/t/clone-via-ssh-only-working-with-full-repo-path/9714/1 "2024-09-12T21:47:03Z")

</div>

Hello,

I’m running into an odd issue while trying to set up Gitea. On the repository page in the browser, gitea generates the ssh address `git@giteaservername.domain:myusername/repo.git`. However, when I run `git clone git@giteaservername.domain:myusername/repo.git` I get the following error:

```auto
Cloning into 'repo'...
fatal: 'myusername/repo.git' does not appear to be a git repository
fatal: Could not read from remote repository.

```

However, the clone completes successfully when I replace `myusername/repo.git` with the full path, `/var/lib/gitea/data/gitea-repositories/myusername/repo.git`.

Why isn’t the shorter path recognized? The relevant sections of my app.ini are shown below, and I’m not seeing anything obviously wrong (e.g. ROOT in [repository] or WORK\_PATH or APP\_DATA\_PATH). If it’s relevant, these repositories were taken from a backup of a previous version of gitea, and adopted via the web admin panel.

```auto
APP_NAME = Name
RUN_USER = git
WORK_PATH = /var/lib/gitea
RUN_MODE = prod

[database]
DB_TYPE = sqlite3
HOST = 127.0.0.1:3306
NAME = gitea
USER = gitea
PASSWD = [removed for forum]
SCHEMA =
SSL_MODE = disable
PATH = /var/lib/gitea/data/gitea.db
LOG_SQL = false

[repository]
ROOT = /var/lib/gitea/data/gitea-repositories

[server]
SSH_DOMAIN = giteaservername.domain
DOMAIN = giteaservername.domain
HTTP_PORT = 3000
ROOT_URL = http://giteaservername.domain:3000/
APP_DATA_PATH = /var/lib/gitea/data
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = true
LFS_JWT_SECRET = 35r-LhIICLonOvh-fxy1zcpWEPYyelCkQf1Pm7aOjBI
OFFLINE_MODE = true

```

---

<div class="post-metadata">

**Author:** ![hmoffatt](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@hmoffatt](https://forum.gitea.com/u/hmoffatt)\
**Post date:** [September 13, 2024, 2:16am UTC](https://forum.gitea.com/t/clone-via-ssh-only-working-with-full-repo-path/9714/2 "2024-09-13T02:16:51Z")

</div>

Do you have any other keys in your git user’s .ssh/authorized keys?

I would guess you are getting logging in over ssh and not running gitea but accessing the git repositories directly.

---

<div class="post-metadata">

**Author:** ![tmiku](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/tmiku/32/6249_2.png) [@tmiku](https://forum.gitea.com/u/tmiku)\
**Post date:** [September 13, 2024, 5:07pm UTC](https://forum.gitea.com/t/clone-via-ssh-only-working-with-full-repo-path/9714/3 "2024-09-13T17:07:48Z")

</div>

There’s only one key listed in /home/git/.ssh/authorized\_keys, starting with  
`command="/usr/local/bin/gitea --config=/etc/gitea/app.ini serv key-1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,no-user-rc,restrict ssh-rsa`.

However, your question reminded me of a detail I missed. When I was setting up the server, I added that same SSH key to /root/.ssh/authorized\_keys using ssh-copy-id. After installing gitea, I added the same key in my user settings in the web app.

Could having the same key in both of those users’ authorized key files cause this? I wouldn’t expect that, because when I run `git clone` I’m specifying the `git` user before the `@`. I’ll be able to test this later today (in ~10 hrs), but let me know if I’m missing anything else important here. Thank you for your help!

---

<div class="post-metadata">

**Author:** ![tmiku](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/tmiku/32/6249_2.png) [@tmiku](https://forum.gitea.com/u/tmiku)\
**Post date:** [September 14, 2024, 11:45pm UTC](https://forum.gitea.com/t/clone-via-ssh-only-working-with-full-repo-path/9714/4 "2024-09-14T23:45:43Z")

</div>

Resolved - disabled Tailscale SSH on the gitea server. Was then able to use same SSH key for server root SSH and my Gitea actions without the path issue.
