Cannot add SSH key #4534

Closed
opened 2025-11-02 05:53:40 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @j-be on GitHub (Dec 22, 2019).

  • Gitea version (or commit ref): 1.10.1
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04.3 LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • SSH
    • OpenSSH
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    Log shows nothing but the [SQL] stuff.

Description

I cannot add any SSH key (tried ed25519, ecdsa 512Bit, rsa 4096 Bit), neither to my user's authorized keys, nor as deploy keys. Not sure if it ever worked, the keys still originate from before I migrated from Gogs to Gitea. UI says:

Can not verify your SSH key: key type is not allowed: rsa

One of the keys in question is:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCwwnj77pp/kk3eq9AmDahFdzvfqNGFfwJ8Sx1JrvVnarwp5zWHz+ogkUOuzT5FghHUvblLfCw0X6gsDRJa537R9+c8qLENYDFFwJuQD+yh5C0FD8I9+k+m/K1WJgBpI9dbqoLvyeLXHLeYsX9SfA3Sx64QTVawxGgPprHPJ3pkHNyS+yr4Q36/bj0litJq+EUD/bLpLGXVEspLwoG3zovtg/BLxv26VoM8ax5wrPx+G5r7EfnH/dAC0y2LUUBfdYReI6hKoPjTNwFOXl6ihl326k0hZs8qUDxWYjIkOCIX5E6VID4nL9u5TpP94tCge+eBBRc1VEAO+K1EuT9m6QdRO8FkEP87ZyzUpcPEKwsoeyCvDsfSjXchqaJYZkkF9IEGLZohMN0pYH1qSESrYse7YaWWIIqDWm8PvIH6ybJXIxMBfwQ3WBywumApggnGGwJQPhKzH6OAVxl2G+0/x4b1fK0iWz6HwckDA5o6r7kMvEDhMVkoPhvpo75AtZ+Vh3g73GhwIM0BEDJCSWTqxEnaomCnQbw4ptCh26NyXCdxaSX0KsUT2IhpR+yzxeP/HNg1FNEi2WXF2XCiSRCaK5vbFYjTQBJ2Qxq7jsQ6WYGD474PX+tDQlKZ2mPja+/1+SXx2cEe5HJSOXNN/HJYmIW+9p3g643bPZqTYrzbldA3Xw== photo@photo-frame

The key works fine on https://try.gitea.io and it is valid, so at least the error message is misleading.

Regarding #974: ssh-keygen is available at the same place as git (being /usr/bin), so I doubt this is the source for the issue.

Regarding #6715: drwx------ 2 git git 4096 Dec 22 15:34 .ssh/, Gitea runs as git

Originally created by @j-be on GitHub (Dec 22, 2019). - Gitea version (or commit ref): 1.10.1 - Git version: 2.17.1 - Operating system: Ubuntu 18.04.3 LTS - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - SSH - [x] OpenSSH - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: Log shows nothing but the `[SQL]` stuff. ## Description I cannot add any SSH key (tried ed25519, ecdsa 512Bit, rsa 4096 Bit), neither to my user's authorized keys, nor as deploy keys. Not sure if it ever worked, the keys still originate from before I migrated from Gogs to Gitea. UI says: ``` Can not verify your SSH key: key type is not allowed: rsa ``` One of the keys in question is: ``` ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCwwnj77pp/kk3eq9AmDahFdzvfqNGFfwJ8Sx1JrvVnarwp5zWHz+ogkUOuzT5FghHUvblLfCw0X6gsDRJa537R9+c8qLENYDFFwJuQD+yh5C0FD8I9+k+m/K1WJgBpI9dbqoLvyeLXHLeYsX9SfA3Sx64QTVawxGgPprHPJ3pkHNyS+yr4Q36/bj0litJq+EUD/bLpLGXVEspLwoG3zovtg/BLxv26VoM8ax5wrPx+G5r7EfnH/dAC0y2LUUBfdYReI6hKoPjTNwFOXl6ihl326k0hZs8qUDxWYjIkOCIX5E6VID4nL9u5TpP94tCge+eBBRc1VEAO+K1EuT9m6QdRO8FkEP87ZyzUpcPEKwsoeyCvDsfSjXchqaJYZkkF9IEGLZohMN0pYH1qSESrYse7YaWWIIqDWm8PvIH6ybJXIxMBfwQ3WBywumApggnGGwJQPhKzH6OAVxl2G+0/x4b1fK0iWz6HwckDA5o6r7kMvEDhMVkoPhvpo75AtZ+Vh3g73GhwIM0BEDJCSWTqxEnaomCnQbw4ptCh26NyXCdxaSX0KsUT2IhpR+yzxeP/HNg1FNEi2WXF2XCiSRCaK5vbFYjTQBJ2Qxq7jsQ6WYGD474PX+tDQlKZ2mPja+/1+SXx2cEe5HJSOXNN/HJYmIW+9p3g643bPZqTYrzbldA3Xw== photo@photo-frame ``` The key works fine on https://try.gitea.io and it is valid, so at least the error message is misleading. Regarding #974: `ssh-keygen` is available at the same place as `git` (being `/usr/bin`), so I doubt this is the source for the issue. Regarding #6715: `drwx------ 2 git git 4096 Dec 22 15:34 .ssh/`, Gitea runs as `git`
Author
Owner

@mrsdizzie commented on GitHub (Dec 22, 2019):

Do yo have MINIMUM_KEY_SIZE_CHECK = true in your config? If so I think this is a bug because the default minimum key lengths aren't set properly so enabling that will cause all key length checks to fail (will send a PR for that in a moment).

@mrsdizzie commented on GitHub (Dec 22, 2019): Do yo have ```MINIMUM_KEY_SIZE_CHECK = true``` in your config? If so I think this is a bug because the default minimum key lengths aren't set properly so enabling that will cause all key length checks to fail (will send a PR for that in a moment).
Author
Owner

@j-be commented on GitHub (Dec 22, 2019):

Yes, MINIMUM_KEY_SIZE_CHECK = true is in my config. Does that mean I can just remove that setting for the time being?

@j-be commented on GitHub (Dec 22, 2019): Yes, `MINIMUM_KEY_SIZE_CHECK = true` is in my config. Does that mean I can just remove that setting for the time being?
Author
Owner

@mrsdizzie commented on GitHub (Dec 22, 2019):

Yes if you disable that it should avoid this bug until it is fixed

@mrsdizzie commented on GitHub (Dec 22, 2019): Yes if you disable that it should avoid this bug until it is fixed
Author
Owner

@j-be commented on GitHub (Dec 22, 2019):

Perfect, thanks a lot for the quick help.

@j-be commented on GitHub (Dec 22, 2019): Perfect, thanks a lot for the quick help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4534