Remix.run Logo
yjftsjthsd-h a day ago

> ssh(1): add a "ssh -Z user@host" mode that prints the keys that will be tried for public key authentication in the order that they will be used.

Oh, that's a nice new feature:)

ghshephard a day ago | parent | next [-]

I don't think there has been a single month in the last 5 years that I haven't had to figure out which public-key was used to authenticate me to a host via `ssh -vv` - often to let someone else who is failing to connect know which key to use.

The `-Z` is less useful - as I almost always know exactly which and what order the public keys are - as most of our sshd instances fail after 5 attempts - so making sure either (A) the correct ones or used or (clumsily, B) - just putting the correct one in the first five to try.

Would be a nice feature to echo which key successfully worked.

seethishat a day ago | parent | next [-]

This is why I keep a ~/.ssh/config file. I store all the hosts and various connection parameters (uernames, alternate ports, keys, etc.) in that file.

Would that work for you?

stingraycharles a day ago | parent | prev [-]

Yup, or the alternative: is authentication failing because I have too many public keys and it just stopped trying after N keys?

ahartmetz a day ago | parent | prev [-]

Yeah, I've occasionally had to divine from verbose debug output that the remote host didn't like more than three or so public key attempts before requiring another auth type.