You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
retrogradeorbit
changed the title
new ssh core cant/wont load existing ssh keys into ssh-agent, but will use them if already loaded into ssh-agent.
spire cant/wont decrypt existing ssh keys into ssh-agent when multiple valid keys present, but will use them if already loaded into ssh-agent.
Apr 3, 2022
Problem predates new Jsch. Have never seen it until now because ssh agent is usually full of decrypted keys.
Appears to be a problem with the way spire's ssh-agent implementation calls the agent. It just issues a sign request straight away on the key. It does not offer the key first to see if the key would be accepted.
ssh does:
debug1: Offering public key: RSA SHA256:j3c87ySHbCUN5CETVky5nRNqABI5Mj8JuqSeBLd8kwk /home/crispin/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: pkalg rsa-sha2-512 blen 535
debug2: input_userauth_pk_ok: fp SHA256:j3c87ySHbCUN5CETVky5nRNqABI5Mj8JuqSeBLd8kwk
debug3: sign_and_send_pubkey: RSA SHA256:j3c87ySHbCUN5CETVky5nRNqABI5Mj8JuqSeBLd8kwk
notice it sends message 50 first (SSH2_MSG_USERAUTH_REQUEST), then receives response 60 (SSH2_MSG_USERAUTH_PK_OK) and then issues the sign_and_send_pubkey call.
spire just takes the first identity and uses that for auth. I was getting confused because the order is different to ssh order.
In spire, when the first key tried fails, the whole auth fails. It does not then try the next key like ssh does.
retrogradeorbit
changed the title
spire cant/wont decrypt existing ssh keys into ssh-agent when multiple valid keys present, but will use them if already loaded into ssh-agent.
Improve spire's use of ssh agent when multiple private keys are available.
Apr 3, 2022
start with a clean ssh-agent.
use spire to initiate an ssh connection to a machine that has your ssh RSA key as an authorized key.
key decryption box appears. key cannot be decrypted with valid passphrase.
ctrl-c
use ssh to connect with same agent.
key decryption box appears. key can now be decrypted. ssh connects
logout the ssh shell
now try spire connection again. now it works.
use
ssh-add -D
to delete all decrypted keystry again. fails.
The text was updated successfully, but these errors were encountered: