Sync Files to an Untrusted Device

I would like to sync files to an untrusted device. Those files are intended as backup. The files should be recoverable when the source computer is not longer available.

Example situation:

  • my kids are “on the road” with a laptop
  • they sync data to my truenas system having a virtual machine running syncthing, storing the data on the nas
  • the laptop crashes or is stolen / whatever
  • I (as NAS admin) should not be able to read their data so the data should be encrypted by syncthing
  • it should be possible to sync the data back to a new laptop assuming the syncthing key of the old lost laptop is known

In the documentation this function is mentioned but marked as beta. And in a 2023 post it was described as not working.

I did test with device settings like “Untrusted” and folder type “Receive Encrypted”. Messages like “remote did not accept sharing this folder do occur”

What ever I need to know the actual status of this functionallity and I need to know how to get this working :slight_smile:

Syncthing’s untrusted/encrypted device feature works fine. However, based on your end goal and functional requirements, I recommend considering using a dedicated backup tool instead of Syncthing or any other sync tool.

Although Syncthing is a fine complement to a backup tool, it isn’t intended to be one.

There are earlier forum posts with recommendations on various backup tools along with combining it with a mesh VPN.

2 Likes

I do have other backup things in place and apart from that, I will create regular zfs snapshots. SyncThing does look as a simple mechanism as additional backup.

I would appreciate if someone could explain exactly how I can reach the described coal, I did try bit not manage :frowning:

Please follow the steps at Untrusted (Encrypted) Devices — Syncthing documentation and make sure that you accept the share on the NAS side. Post screenshots of the UI on both sides if it doesn’t work.

I will try, I have looked at that side before. The message at the top “This feature should still be considered beta / testing only.” That did not help (just as another page from end 2023 between some user and the designer, telling that it was not yet working).

I see now that I have to add some text rules in the configs, something I did absolutely not expect.

I did test and it worked !! :smiling_face_with_three_hearts:

I did:

  • share a folder with the untrusted device

  • removed the folder from the source device

  • removed the folder itself

  • did create a new folder on the source device, with another name and the Original folderId and password

  • defined that it should share with the untrusted device

  • and yep(!) the test file did arrive from the untrusted device

  • the only thing I should test is what would happen if I delete the syncting instance from the trusted source device

  • and installed it again using the old identification code

  • I just do not know how to do that, assumping the indentification code is the public key, there should be some private key arround somewhere and I should have back-uped those keys before somewhere

Do you happen to know how to backup and restore the Syncthing itself on the source?

Or as an alternative perhaps should I add a new installed SyncThing Id from on the trusted device to the untrusted device to resync that way? I do not think the second option is possible given the foldertype and the fact that I can not add a new shared forlder there.

Perhaps I can change the Source original Id (=pubkey?) in a config file somewhere in a new source key Id (if the keys are not encrypted / protected). If this option is possible, it is … a big security leak(!)

2 Likes

The Folder password is the key. Lose that, and your files will not decrypt.

Changing the pubkey affects the local Device, not the folder nor the files therein.

While I am not a member of the Syncthing team (I try to help here as I can) I have been a cybersecurity professional for decades. I can’t make security decisions for you, but when I read https://docs.syncthing.net/users/security.html , I was satisfied that Syncthing is secure enough for my most sensitive personal files; I sync password databases with it.

2 Likes

No, not true. I found the keys and the db in windows in “C:\ProgramData\Syncthing”.

I think I have to backup that directory. Did notyet try :slight_smile:

See Understanding Device IDs — Syncthing documentation — the certificate is hashed to produce the Device ID. It seems that you found the key to that certificate. Losing this means losing the Device ID.

The index database is described here: https://docs.syncthing.net/users/syncing.html . If this is lost, Syncthing will rebuild it.

I will describe the backup and restore syncthing procedure I used to backup for the case you loose your pc/laptop for some reason in a separate thread

Its good to have a backup of the config.xml and certificates, but losing them only means that you will have to accept the “new” device on the TrueNAS.

Saving the encryption password (for the untrusted device) is the key to being able to restore the data later.

  1. Assume the source device is lost.
  2. Install a new copy of Syncthing
  3. Add the TrueNAS device to the new device.
  4. Accept the new device on the TrueNAS.
  5. Share the “backup” folder from TrueNAS to the new device.
  6. Accept the “backup” folder on the new device, and enter the encryption password.
  7. Files and folders will copy to the new device, and Syncthing will save them in “plaintext” using the encryption password.
1 Like

So do not rely on a text file with the password in the folder share :facepalm: :laughing:

1 Like