Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add SSH key #9465

Closed
3 of 8 tasks
j-be opened this issue Dec 22, 2019 · 4 comments · Fixed by #9466
Closed
3 of 8 tasks

Cannot add SSH key #9465

j-be opened this issue Dec 22, 2019 · 4 comments · Fixed by #9466

Comments

@j-be
Copy link

j-be commented 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

@mrsdizzie
Copy link
Member

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 added a commit to mrsdizzie/gitea that referenced this issue Dec 22, 2019
The minimum key size defaults weren't set as suggested in app.ini.sample
so if you enabled MINIMUM_KEY_SIZE_CHECK it would always fail since
there would be no matching values to check against. This pr adds the
default values that should have been there.

Should fix go-gitea#9465
@j-be
Copy link
Author

j-be commented 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?

@mrsdizzie
Copy link
Member

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

@j-be
Copy link
Author

j-be commented Dec 22, 2019

Perfect, thanks a lot for the quick help.

sapk pushed a commit that referenced this issue Dec 22, 2019
The minimum key size defaults weren't set as suggested in app.ini.sample
so if you enabled MINIMUM_KEY_SIZE_CHECK it would always fail since
there would be no matching values to check against. This pr adds the
default values that should have been there.

Should fix #9465
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants