I own exactly two computers. Both of them run Ubuntu.
Since I bought the second to largely replace the first, initially I copied my home directory over to the new laptop and all was well. However, I ended up using both, and their state started to diverge.
To maintain a similar environment, I would like to sync the dot files between these two machines. Preferably without needing them to be on at the same time or in the same place.
My dotfiles contain virtually everything of electronic importance to me: passwords in pass, the GPG keys, SSH keys, know hosts, etc.
How can I simply and securely sync my dotfiles between two computers running Ubuntu?
If it helps, I do have always-on servers which could act as intermediaries but I don't trust their security enough to allow data like this on them in plaintext.
With simplicity in mind : Buy a cheap usb stick, encrypt it, and copy the file on that stick when you need to move files from one computer to another. Or buy a less cheap self encrypting usb disk or stick.
Instead of a usb stick, use a disk image file, that you can even copy to the untrusted servers. But you'll have to copy the file from one computer to the other, via temp storage on the servers. So in the end, 3 copies are around... Probably exactly what is needed to mess things up.
Instead of copying files, on the encrypted storage (usb stick or disk image), use unison. It's available via apt. Unison can perform two way synchronisation (what they call reconciliation, I think). See the unison user manual. This is less simple to set up.
Or, another simple way : tar your dotfiles, encrypt with gpg, put on the untrusted servers. Ask your search engine for GPG usage. This site is a possibility. But again, 3 copies will rapidly exist...
What I suggest is using a "private git repository on Gitlab".
And of course you have to exclude your important data if you don't trust Gitlab owners or employees.
You can also create a simple script which creates an archive from your passwords, keys, etc and then encrypts those using your GPG then add and commit that instead of plain text information.
There is a really nice guide here: The best way to store your dotfiles: A bare Git repository
or if your computers are sitting at the same network just clone your local repository.