Skip to content

What's your favorite way to encrypt your home directory ?

Hi,

I'm used to encrypt my entire disk with dm-crypt. But this solution have few cons :
- You can't wake up your machine via the network as you'll have to enter physically your passphrase to boot up the machine
- Can't have multiple users without sharing the main passphrase

So I'm looking how to only encrypt home directories, so far I saw systemd-homed ? dm-crypt with automounting on login ? something else ?

Thank you in advance !

5 points18 comments
Open on Reddit
About this post
Posted
Archived
Score
5 · 74% up
Kind
Text
ID
i45702

Author

8
posts
53
comments
1
media
View profile

18 comments

unknown author1 hidden
  • You can't wake up your machine via the network as you'll have to enter physically your passphrase to boot up the machine

with unencrypted boot, and dropbear in initramfs (or other such solutions) you can do that too

Can't have multiple users without sharing the main passphrase

LUKS supports multiple passphrases, but yeah sure it still opens the very same encryption container in the end.

Have a blink at systemd-homed then. I never used it myself, sorry.

But this has a lot of cons too. You can backup all files in a full disk encryption scenario. You might not be able to if users encrypted their homedir without you knowing the key (when using filesystem based encryption as ext4 and others offer).

7 points

It's mainly for a personal usage, I guess you can still backup if you encrypt at the filesystem level (but I won't try this solution :D).
I think I'll try systemd-homed and backup while my session is opened.

2 points

If you've got multiple users and you want each user to be able to encrypt their own home directory with their own passphrase, systemd-homed seems like the obvious solution to me.

5 points

Actually there are hooks that allow you to SSH into the machine before it tries to mount rootfs (see wiki. Multiple users depends, if you have multiple users with root access then file based encryption is the only way to stop them, otherwise it's ok.
I find FBE a bit finicky, it doesn't always lock when you logout for example.

4 points

I didn't know that solution, I'll have a look :)

2 points

Be aware that the system may write sensitive log files or credentials outside of ~ in case you decide to go ahead with this.

2 points

Do you have an exemple on mind ? Logging credentials is a bad practice coming from dark ages :)

1 points

Sure, for example NetworkManager needs to save credentials for networks that multiple users may access.

Systems are complex enough that I just generally wouldn't trust every single component to be responsible about not leaking data. And it's not just creds, but also stuff like paths to files, which users logged in when and countless other details which leave forensically useful info.

That's why I'd recommend you to use FDE with SSH in the initramfs (solves requirement 1) combined with home directory encryption on top of that FDE (solves requirement 2).

2 points
unknown author8 hidden

I use lvm on luks. Systemd-homed is good for enterprise i think (you can carry your home directory on you and use any computer to do your stuff in a work environment) but for personal computers is completely unnecessary.

1 points

So you mount your partition on login ?

1 points
unknown author3 hidden

I decrypt my lvm during boot stage. Since my root and home partitions are on the same lvm; its decrypted along with the root. Then i use fstab for mounting.

1 points

I would argue LVM is completely unnecessary when you can just use a filesystem with subvolumes and all kinds of other advantages. Not to mention if OP wants to encrypt home directories only, with multiple users, LVM becomes overly cumbersome to maintain with adding and removing users requiring adding and removing more LVs whereas systemd-homed is as simple as creating a new home directory.

1 points
unknown author1 hidden

What I suggest is that you use one LUKS container to encrypt every partition you have under LVM. (I think you misunderstood my case as LUKS on LVM, while I do LVM on LUKS for full disk encryption) At no point do i suggest encrypting a new container for each home directory. Obviously yes; systemd-homed is going to be the most convenient way if you are going that route, but also why would you ever want to create new LV for each user? You could use a fs with quotas if you want to isolate them so bad.

Also; this advice of subvolumes for everything is not universal. I like keeping my home partition on a different fs than the root partition.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.