this post was submitted on 18 Jun 2025
26 points (96.4% liked)

Selfhosted

46672 readers
958 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 2 years ago
MODERATORS
 

I use a headless server connected to nothing but an ethernet cable in my basement, and I'd prefer to allow the thing to boot by itself and start up without me needing to unlock the disk encryption every single time I do an update or power back on. Its a Dell 9500t NUC that I'm using it as a server and am wondering whether its possible to encrypt everything still.

I do generally use docker containers, so could I potentially encrypt just the containers themselves, assuming I'm worried about a smash and grab rather than someone keeping the machine powered up and reading my ram?

all 18 comments
sorted by: hot top controversial new old

Check Mandos , if you are able to secure enough the server (inside a safe box?) then you are good

[–] I2jgwh0hYtxrCZQ@lemmy.sdf.org 3 points 2 hours ago* (last edited 2 hours ago) (1 children)

I read somewhere someone had their encryption key on their phone / another server and had the server pull the key via ftp on boot. Then the server and encryption key is separated but can decrypt its self as long on the ftp server is available.

Edit - might have been unraid where the OS and data drivers are separate

[–] lorentz@feddit.it 1 points 1 hour ago

I've configured something similar. The /boot partition is the only unencrypted. In the initramfs there is a script that downloads half of the decryption key from http, while the other half is stored in the script itself. The script implements automated retry until it can fetch the key and decrypt the root partition.

My attack model here is that, as soon as I realize someone stole my NAS I can shutdown the server hosting half of the decryption key making my data safe. There is a window where the attacker could connect it to a network and decrypt the data, but it is made more difficult by the static network configuration: they should have a default gateway with the same IP address of mine.

On my TODO list I also have to implement some sort of notification to get an alert when the decryption key is fetched from internet.

[–] theunknownmuncher@lemmy.world 26 points 8 hours ago (1 children)

If it can power up and decrypt the docker volumes on its own without prompting you for a password in your basement, it will also power up and decrypt the docker volumes on its own without prompting the robbers for a password in their basement

[–] morethanevil@lemmy.fedifriends.social 8 points 7 hours ago (1 children)

Exactly, I don't get why people want (full disk) encryption, but with automounted keyfiles after reboot 😂

[–] ryokimball@infosec.pub 6 points 7 hours ago (2 children)

First reason I think of to use fde all the time even if it's automatically unlocked, is it's simple to securely delete everything all at once. Just delete all the keys or overwrite that section of the desk.

[–] lorentz@feddit.it 1 points 1 hour ago

Second reason. It may run your vpn, with the server down you cannot connect to it and provide the decryption key unless you are connected to the same network.

There are some good answer around where the server can easily decrypt automatically as long as it is connected in your home but will likely fail at a thief's home. These are a much safer setup than keeping data unencrypted even if they are not bullet proof.

[–] catloaf@lemm.ee 1 points 7 hours ago (1 children)

Depends on how you want to define "securely". A sufficiently motivated attacker could attack the remaining encrypted data, either through brute force or exploiting a weakness in the algorithm.

[–] ftbd@feddit.org 2 points 4 hours ago

If you find an encrypted drive, it's extremely unlikely you can recover anything from it. If there is no LUKS header, it's pretty much impossible.

[–] partial_accumen@lemmy.world 12 points 7 hours ago (1 children)

assuming I’m worried about a smash and grab

For your specific use case, how about this:

Get a cheap USB thumb drive and a long USB cable. Put your disk unlock password on that thumb drive, and semi-permanently affix the USB drive to your building. You said you're in a basement. Put it on top of a rafter with a metal fitting that would keep the drive from being taken without removing the screws. Run the long USB cable from the thumb driving in your rafter to the USB port on the machine. Alter your startup script to mount the thumb drive read the password from the thumb drive to unlock your main disk. Don't forget to immediately unmount the thumbdrive in the OS after the disk is unlocked for extra safety.

If someone is doing a smash and grab, they'll unplug all the cables (including this USB cable going to the thumb drive) and take your machine leaving the disk encryption password behind on the USB thumb drive.

[–] Shimitar@downonthestreet.eu 4 points 6 hours ago

This is a good idea. Use an cat5 USB extender for maximum range (100mt) and put the USB drive even further away.

[–] just_another_person@lemmy.world 6 points 7 hours ago

TPM2+Tang+Clevis. You'll need to get really familiar with the TPM registers to properly set something up that will meet specific criteria, but you can make a pretty safe system with Tang that you can enable/disable remotely.

[–] autonomoususer@lemmy.world 3 points 7 hours ago
[–] bzLem0n@lemmy.ca 3 points 7 hours ago (1 children)

If you have TPM2 support on the motherboard it can be used to unlock LUKS encryption but has the following known vulnerability.

https://oddlama.org/blog/bypassing-disk-encryption-with-tpm2-unlock/

[–] lorentz@feddit.it 1 points 1 hour ago

The issue I see with TPM is that it will always unlock the drive as long as it is connected to the same motherboard. It means you have to trust all the services you run to be correctly secured. Like there is little reason to encrypt your hard drive in this way if later you have a samba share open without any password.

[–] prettybunnys@piefed.social 2 points 7 hours ago

https://www.golinuxcloud.com/network-bound-disk-encryption-tang-clevis/

something like clevis/tang might help but ultimately if someone has physical access to your box then they can potentially get it all anyways 🤷

[–] ryokimball@infosec.pub 1 points 7 hours ago

Yes, you can have docker scripts decrypt a drive/storage. You might also consider an encrypted home partition separate from the root partition, or user space encryption of your home directory.