this post was submitted on 05 Jul 2024
35 points (97.3% liked)

Selfhosted

40347 readers
433 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I'm in desparate need of setting up borgmatic for borg backup. I would like to encrypt my backups. (I suppose, an unencrypted backup is better than none in my case, so I should get it done today regardless.)

How do I save those keys? Is there a directory structure I follow? Do you backup the keys as well? Are there keys that I need to write down by hand? Should I use a cloud service like bitwarden secrets manager? Could I host something?

Im ignorant on this matter. The most I've done is add ssh keys to git forges and use ssh-copyid. But I've always been able to access what I need to without keeping those (I login to the web interface.) Can you share with me best practices or what you do to manage non-password secrets?

all 13 comments
sorted by: hot top controversial new old
[–] hendrik@palaver.p3x.de 29 points 4 months ago* (last edited 4 months ago) (1 children)

I add such stuff to my password manager. It supports files. But not all password managers do. I have a category for admin stuff where I also save passwords to servers, database credentials, service logins and the exported LUKS keys of the harddrives. I'd add backup keys there, too, but I currently keep them unencrypted on an encrypted harddisk.

[–] CloseSymbol@lemmy.world 7 points 4 months ago

Also using my password manager, keepass2 in my case (synced over webdav). A password manager should provide plenty of options to structurize. Password database is a part of scheduled backups, and always present on multiple synced devices, so a total loss is hardly imaginable.

As SSH keys were also touched as a topic in the OP, I just wanted to add I just found that there seems to be an addon for keepass that makes handling those even easier: https://lechnology.com/software/keeagent/ (haven't tried that yet).

[–] RegalPotoo@lemmy.world 13 points 4 months ago

For anything that is related to my backup scheme, it's printed out hard copy, put in an envelope in a fire safe in my house. I can tell you from experience there is nothing more stressful than "oh fuck I need my backups but the key to unlock the backups is in the backups fuck fuck fuck".

And for future reference, anyone thinking about breaking into my house to get access to my backups just DM me, I'm sure we can come to an arrangement that's less hassle for both of us

[–] EncryptKeeper@lemmy.world 11 points 4 months ago

Password manager. Many allow you to attach a file to a set of credentials

[–] Lem453@lemmy.ca 6 points 4 months ago

Bitwarden let's you upload files (key files) and save all you passwords.

[–] fullstackhipster@awful.systems 5 points 4 months ago* (last edited 4 months ago) (1 children)

There are many ways to go about this. Files like those keyfiles and encryption headers are extra sensitive because (a) they potentially provide access to everything and (b) losing them can block access to everything. Personally, I keep those types of files unencrypted in a directory that stays 100% offline (encrypted backups to external disks only). But there's no reason not to back those files up to an encrypted online repository (where you trust the encryption). Just make sure that's not your only backup of those files for obvious reasons.

A good practice to avoid painting yourself in a corner is to test your backups: Switch off your PC / server, put your mobile devices in a drawer (pretend they're gone), borrow / wipe a cheap laptop. How do you access your backup files using just that laptop?

[–] Dave@lemmy.nz 4 points 4 months ago (1 children)

But if your encryption keys to your offsite backup are on-site only, doesn't that make your offsite backup worthless in the case where "offsite" is important?

If your house burns down, you don't have your encryption keys to your only backup.

[–] fullstackhipster@awful.systems 3 points 4 months ago (2 children)

Good catch... and that's why I keep up-to-date encrypted offline backups in two locations (home and office) always. That should be enough really, but I've been thinking about swapping one of those drives with a third backup at one of my relatives' house from time to time, just to make irrecoverable failure even less likely.

[–] Dave@lemmy.nz 1 points 4 months ago (1 children)

So you keep an encrypted backup at work with the decryption key at home, and an encrypted backup at home with the decryption key at work?

[–] fullstackhipster@awful.systems 2 points 4 months ago

No, that would clearly defeat the purpose of redundant backups. I remember the passphrases for my backups.

[–] tootnbuns@lemmy.dbzer0.com 2 points 4 months ago

I just encrypt the whole backup drive and sync the files to that drive.

[–] krdo@programming.dev 1 points 4 months ago

Yes, you should have backups. You can use something like KeePass to store them I suppose. I personally just use the file system on a secure server.