Cloning via SSH doesn't work #971

Closed
opened 2025-11-02 03:43:49 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @kiirkegaard on GitHub (Aug 17, 2017).

  • Gitea version (or commit ref): 1.1.3
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04.2 LTS
  • Database (use [x]):
    • PostgreSQL
    • [x ] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [x ] Not relevant
  • Log gist:

Description

I found a few similar issues on the gog and gitea tracker, but in my case it's a fresh install.

My repositories reside in "/home/garfield/gitea-repositories/garfield/"

When trying to clone via ssh, the clone URL omits the "/home/garfield" part but displays ssh://domain.com/garfield/example.git. Which leads to the git error:


garfield@machine>git clone ssh://garfield@mydomain:222/garfield/playground.git
Cloning into 'playground'...
fatal: '/garfield/playground.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Adding "/home/garfield/gitea-repositories" between domain name and "garfield/example.git" makes it work.

Originally created by @kiirkegaard on GitHub (Aug 17, 2017). - Gitea version (or commit ref): 1.1.3 - Git version: 2.7.4 - Operating system: Ubuntu 16.04.2 LTS - Database (use `[x]`): - [ ] PostgreSQL - [x ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x ] Not relevant - Log gist: ## Description I found a few similar issues on the gog and gitea tracker, but in my case it's a fresh install. My repositories reside in "/home/garfield/gitea-repositories/garfield/" When trying to clone via ssh, the clone URL omits the "/home/garfield" part but displays ssh://domain.com/garfield/example.git. Which leads to the git error: ``` garfield@machine>git clone ssh://garfield@mydomain:222/garfield/playground.git Cloning into 'playground'... fatal: '/garfield/playground.git' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` Adding "/home/garfield/gitea-repositories" between domain name and "garfield/example.git" makes it work.
GiteaMirror added the type/question label 2025-11-02 03:43:49 -06:00
Author
Owner

@lafriks commented on GitHub (Aug 17, 2017):

Do you run gitea under garfield user?

@lafriks commented on GitHub (Aug 17, 2017): Do you run gitea under garfield user?
Author
Owner

@kiirkegaard commented on GitHub (Aug 17, 2017):

So far, yes. It's not running a service yet.

@kiirkegaard commented on GitHub (Aug 17, 2017): So far, yes. It's not running a service yet.
Author
Owner

@bkcsoft commented on GitHub (Aug 24, 2017):

Looks like the git-hooks are broken, can you try pressing the "rebuild git-hooks" button in the admin-panel and see if that fixes it?

@bkcsoft commented on GitHub (Aug 24, 2017): Looks like the git-hooks are broken, can you try pressing the "rebuild git-hooks" button in the admin-panel and see if that fixes it?
Author
Owner

@kiirkegaard commented on GitHub (Aug 25, 2017):

The problem was in the SSH-keys section in the user control panel. I previously added my keys to the authorized_keys, which apparently I should have done via the web frontend.
Afterwards the authorized_key file had to be recreated via the admin control panel.
It's working now, thanks

@kiirkegaard commented on GitHub (Aug 25, 2017): The problem was in the SSH-keys section in the user control panel. I previously added my keys to the authorized_keys, which apparently I should have done via the web frontend. Afterwards the authorized_key file had to be recreated via the admin control panel. It's working now, thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#971