SSH key syncronization with Syncthing?

Would it be a bad thing to use Syncthing to synchronize ssh keys from one device to another?

For instance if you are replacing one device with another or even using a second device.

I know that best practice would be generating a key for each device but that does require for you to update the keys on all remote nodes your are connecting to. I do know Ansible would be great for that but for instance TrueNAS, slefhosted git repos may require you to login and update/replace the keys in their respective portal. Or would just switch to a jumpbox setup be the best approach?

Some input on this would be much appreciated.

Edit**

  • I use ansible to keep my ssh config in a known good state

I think moving the key is not the issue. That will work fine, what will break is the known hosts file and the authorized keys file. If each of those gets written to on multiple hosts, I suspect you will get lots of errors, and SSH will stop working.

1 Like

The parts the could be automated with Syncthing is keeping the authorized_keys file updated on the target host running ssh and on the systems you are using ssh from Syncthing can sync the known_hosts & config but I would not sync the keys. I just use Syncthing to sync the config on my systems.

1 Like