Skip to content

Cannot add SSH key #9465

@j-be

Description

@j-be
  • 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

Activity

mrsdizzie

mrsdizzie commented on Dec 22, 2019

@mrsdizzie
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).

j-be

j-be commented on Dec 22, 2019

@j-be
Author

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

mrsdizzie

mrsdizzie commented on Dec 22, 2019

@mrsdizzie
Member

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

j-be

j-be commented on Dec 22, 2019

@j-be
Author

Perfect, thanks a lot for the quick help.

added a commit that references this issue on Dec 22, 2019
2f9564f
locked and limited conversation to collaborators on Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @mrsdizzie@j-be

      Issue actions

        Cannot add SSH key · Issue #9465 · go-gitea/gitea