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

SSHKeyPair: issues with existing keys on a machine #149

Open
Ma27 opened this issue Feb 21, 2024 · 0 comments
Open

SSHKeyPair: issues with existing keys on a machine #149

Ma27 opened this issue Feb 21, 2024 · 0 comments

Comments

@Ma27
Copy link
Member

Ma27 commented Feb 21, 2024

On one VM we had two files in ~/.ssh: ~/.ssh/id_ed25519 & ~/.ssh/id_ed25519.pub.
I wanted to deploy an SSH keypair to said machine and basically did

[component:sshkeypair]
id_ed25519 = <redacted>

Now, ~/.ssh/id_ed25519 had the correct private key, but ~/.ssh/id_ed25519.pub had an old public key.

Interestingly, this lead to SSH failing with "Permission denied (public key)" while cloning a git repository. The issue could be fixed by updating the .pub file, though I'm pretty sure that removing it would've solved the issue as well.

This is counter-intuitive and should be changed IMHO. I'd suggest that when updating the private key, the corresponding pubkey should be removed or always being derived from the private key (i.e. ssh-keygen -y -f ~/.ssh/id_ed25519). To me, this seems like a more sensible default than what we currently have, so I'd explicitly suggest to make this the default given how SSH behaves if pubkey and private key don't match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant