colmena
colmena copied to clipboard
Use the same SSH session for key uploads
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.
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).
Sounds good - will give that workaround a try.