Score:0

How to keep an encrypted home directory mounted (even after logout)

kr flag

Sometimes I'd like to ssh to a machine, mount my encrypted home directory and disconnect and keep the directory mounted.

What I managed already to do is

  • ssh to my machine (without password only public keys are allowed for security reasons)
  • create a tmux session
  • mount the file system in the tmux session
  • cd into the home directory
  • execute some script that will run for a long time
  • detach the tmux session
  • logout

if I login again and attach to the tmux session, I see, that my script continues to run as long as it uses only relative path names.

However if I access absolute path names I see, that my home directory has been unmounted.

Is there any trick to keep it mounted.

waltinator avatar
it flag
That's contrary to the intent of encrypted home directories. Make a separate directory, not under `$HOME/` that will stick around.
gelonida avatar
kr flag
The exact intent of an encrypted home directory leaves space for interpretation. Till now I used the machine as a desktop. and if I needed the filesystem to be available I did a graphical log in, started the necessary tasks and locked the screen. reconnected and logged out when done. Now I want to remove the display and do the same over ssh access. log in, start processes (disconnect instead of locking the screen) and reconnect and unmount when done. Encrypted home directories are still very useful as stolen disks / PCs have no readable data.
Hugo avatar
mx flag
Could you use full disk encryption instead and leave the home directories unencrypted?
gelonida avatar
kr flag
This is an interesting idea for new machines However the machine is already setup so if possible I don't want to change the disk layout.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.