colmena icon indicating copy to clipboard operation
colmena copied to clipboard

Use the same SSH session for key uploads

Open RealityAnomaly opened this issue 3 years ago • 2 comments

This is a rather minor issue, but I've observed a new SSH session will be initiated for every key uploaded. When you have a lot of keys to upload and a YubiKey which doesn't authenticate you instantly it takes a bit longer. Would be good to just use the same session for each host.

RealityAnomaly avatar Feb 11 '21 03:02 RealityAnomaly

Yup, this is a good point. I considered using the thrussh or ssh2 libraries which would give me much more flexibility in reusing the same session for multiple channels, but neither provides a good way to implement ssh_config support (i.e., they don't read your ~/.ssh/config so the IdentityFiles and fancy options you set there won't work).

An interim workaround is to enable the ControlMaster feature in your ~/.ssh/config to persist SSH connections: https://puppet.com/blog/speed-up-ssh-by-reusing-connections/. I've been using it and it makes the ssh experience much smoother (especially if you have some slow/interactive auth).

zhaofengli avatar Feb 11 '21 04:02 zhaofengli

Sounds good - will give that workaround a try.

RealityAnomaly avatar Feb 11 '21 04:02 RealityAnomaly