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

Replace pubkey with privkey in keys_ssh.tmpl #20112

Merged
merged 3 commits into from
Jun 24, 2022
Merged

Replace pubkey with privkey in keys_ssh.tmpl #20112

merged 3 commits into from
Jun 24, 2022

Conversation

rluetzner
Copy link
Contributor

If a user wants to verify an SSH public key from their account they have
to sign the randomly generated token with their private key.

Prior to this change the example command prompted to sign the token with
their public key instead.

Signed-off-by: Robert Lützner [email protected]

If a user wants to verify an SSH public key from their account they have
to sign the randomly generated token with their private key.

Prior to this change the example command prompted to sign the token with
their public key instead.

Signed-off-by: Robert Lützner <[email protected]>
@rluetzner
Copy link
Contributor Author

Call me stupid, but I just ran into this when I tried to verify my SSH key. Of course it has to be the public key, but I blindly followed the instructions.

Here's an image showing what I changed:

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 23, 2022
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 24, 2022
Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should work with pub too as it points to the priv ...
but directly pointing to priv do also work

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 24, 2022
@rluetzner
Copy link
Contributor Author

it should work with pub too as it points to the priv

@6543 , you're right. I didn't check that yesterday, but tried it out just now.

I encountered an issue when verifying my SSH key yesterday. It basically told me that something seems to have expired. Maybe if I had just retried it immediately with the path to my public key it would have worked as well. I used my private key the second time around and it worked, so I assumed that the hint is wrong.

Thanks for clearing that up. 🙂

@wxiaoguang
Copy link
Contributor

According to man:

     -Y sign

The key used for signing is specified using the -f option and may refer to 
either a private key, 
or a public key with the private half available via ssh-agent(1)

Keep the pubkey is more likely to be how the key is used by ssh. Then I think we can keep the old prompt.

@6543 6543 merged commit afea63f into go-gitea:main Jun 24, 2022
@6543
Copy link
Member

6543 commented Jun 24, 2022

oh damed - just merged :X

@wxiaoguang
Copy link
Contributor

nvm, either is fine. indeed the purpose is to check the key itself. private key works in all cases.

zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 24, 2022
* giteaoffical/main:
  Move eslintrc/stylelintrc to non-deprecated extensions (go-gitea#20110)
  Allow manager logging to set SQL (go-gitea#20064)
  Replace pubkey with privkey in keys_ssh.tmpl (go-gitea#20112)
  Update security information to add a public gpg key to make sending encrypted message possible (go-gitea#20117)
vsysoev pushed a commit to IntegraSDL/gitea that referenced this pull request Aug 10, 2022
If a user wants to verify an SSH public key from their account they have
to sign the randomly generated token with their private key.

Prior to this change the example command prompted to sign the token with
their public key instead.

Signed-off-by: Robert Lützner <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants