forgejo/discussions
49
43

fatal: Could not read from remote repository. #437

Open
opened 2026年01月19日 00:18:11 +01:00 by linuxpython · 4 comments

I've just noticed that ForgeJo LTS seems to be unable to handle my ED25519 SSH key, and instead insists on an RSA key. I noticed the hard way because I initially only added an ED25519 key and then was unable to push to the repo until I also added an RSA key. Is this to be expected?

I've just noticed that ForgeJo LTS seems to be unable to handle my ED25519 SSH key, and instead insists on an RSA key. I noticed the hard way because I initially only added an ED25519 key and then was unable to push to the repo until I also added an RSA key. Is this to be expected?

Maybe the length of your key is too small or ED25519 is disabled? See https://forgejo.org/docs/v11.0/admin/config-cheat-sheet/#ssh-minimum-key-sizes-sshminimum_key_sizes for the (default) minimum sizes.

Maybe the length of your key is too small or ED25519 is disabled? See https://forgejo.org/docs/v11.0/admin/config-cheat-sheet/#ssh-minimum-key-sizes-sshminimum_key_sizes for the (default) minimum sizes.
Owner
Copy link

If Forgejo accepted the key in the settings, it is accepted. Otherwise, it tells you about the problem while adding the key.

The most common cause for this is an SSH configuration that enforces a certain key. Could you run ssh -T git@your-forgejo-instance (with another user than git if you chose another one, this is the Forgejo system user, not your personal user account)? It allows to see if Forgejo thinks you are someone else.

you can repeat the above command with explicit files like

ssh -T git@your-instance -i /home/.../.ssh/my-ed25519-key

to see if this is accepted.

If Forgejo accepted the key in the settings, it is accepted. Otherwise, it tells you about the problem while adding the key. The most common cause for this is an SSH configuration that enforces a certain key. Could you run `ssh -T git@your-forgejo-instance` (with another user than git if you chose another one, this is the Forgejo system user, not your personal user account)? It allows to see if Forgejo thinks you are someone else. you can repeat the above command with explicit files like ~~~ ssh -T git@your-instance -i /home/.../.ssh/my-ed25519-key ~~~ to see if this is accepted.

@mahlzahn wrote in #437 (comment):

Maybe the length of your key is too small or ED25519 is disabled? See https://forgejo.org/docs/v11.0/admin/config-cheat-sheet/#ssh-minimum-key-sizes-sshminimum_key_sizes for the (default) minimum sizes.

My ED25519 key is 512 bits long, which should be enough (min is half that).

@fnetX If I use this command:

ssh -T git@your-instance -i /home/.../.ssh/my-ed25519-key

Then I get a login banner, but then, the session hangs. If I use the same command without specifying the key (my agent has both the RSA and ED25519 keys), then I get a message that I have successfully authenticated, but that ForgeJo doesn't provide shell access. If I use the command without '-T', I can log in with the ED25519 key and get a shell.

@mahlzahn wrote in https://codeberg.org/forgejo/discussions/issues/437#issuecomment-9963054: > Maybe the length of your key is too small or ED25519 is disabled? See https://forgejo.org/docs/v11.0/admin/config-cheat-sheet/#ssh-minimum-key-sizes-sshminimum_key_sizes for the (default) minimum sizes. My ED25519 key is 512 bits long, which should be enough (min is half that). @fnetX If I use this command: ``` ssh -T git@your-instance -i /home/.../.ssh/my-ed25519-key ``` Then I get a login banner, but then, the session hangs. If I use the same command without specifying the key (my agent has both the RSA and ED25519 keys), then I get a message that I have successfully authenticated, but that ForgeJo doesn't provide shell access. If I use the command without '-T', I can log in with the ED25519 key and get a shell.
Owner
Copy link

This sounds like a misconfiguration with your SSH server. I think you should not be able to sign in using this key and this user. You might want to check your /home/git/.ssh/authorized_keys files to see if it only contains entries managed by Forgejo, and not twice your key.

All entries should look like this:

# gitea public key
command="/data/git/bin/forgejo --config=/etc/forgejo/conf/app.ini serv key-3",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,no-user-rc,restrict ssh-ed25519 AAAA... keyname

Before removing the key, please make sure that you have another way to log in to your system (e.g. another user or another key), so that disabling shell access for this key does not lock you out. Then, remove the key without the command prefix (or put it behind a comment).

This sounds like a misconfiguration with your SSH server. I think you should not be able to sign in using this key and this user. You might want to check your /home/git/.ssh/authorized_keys files to see if it only contains entries managed by Forgejo, and not twice your key. All entries should look like this: ~~~ # gitea public key command="/data/git/bin/forgejo --config=/etc/forgejo/conf/app.ini serv key-3",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,no-user-rc,restrict ssh-ed25519 AAAA... keyname ~~~ Before removing the key, please make sure that you have another way to log in to your system (e.g. another user or another key), so that disabling shell access for this key does not lock you out. Then, remove the key without the command prefix (or put it behind a comment).
Sign in to join this conversation.
No Branch/Tag specified
No results found.
No results found.
Labels
Clear labels
User research - Accessibility
Requires input about accessibility features, likely involves user testing.
User research - Blocked
Do not pick as-is! We are happy if you can help, but please coordinate with ongoing redesign in this area.
User research - Community
Community features, such as discovering other people's work or otherwise feeling welcome on a Forgejo instance.
User research - Config (instance)
Instance-wide configuration, authentication and other admin-only needs.
User research - Errors
How to deal with errors in the application and write helpful error messages.
User research - Filters
How filter and search is being worked with.
User research - Future backlog
The issue might be inspiring for future design work.
User research - Git workflow
AGit, fork-based and new Git workflow, PR creation etc
User research - Labels
Active research about Labels
User research - Moderation
Moderation Featuers for Admins are undergoing active User Research
User research - Needs input
Use this label to let the User Research team know their input is requested.
User research - Notifications/Dashboard
Research on how users should know what to do next.
User research - Rendering
Text rendering, markup languages etc
User research - Repo creation
Active research about the New Repo dialog.
User research - Repo units
The repo sections, disabling them and the "Add more" button.
User research - Security
User research - Settings (in-app)
How to structure in-app settings in the future?
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
forgejo/discussions#437
Reference in a new issue
forgejo/discussions
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?