Mounted LUKS file turns into plaintext directory

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Mounted LUKS file turns into plaintext directory



I followed the CentOS instructions to create a Linux Encrypted Filesystem with dm-crypt.



This results in what appears to be an encrypted file mounted as a file system, when I checked losetup -l, mount -l and cryptsetup status secretfs, everything looked as would be expected.


losetup -l


mount -l


cryptsetup status secretfs



After restarting the computer, and without issuing any commands to losetup, cryptsetup and mount, the mounted (before restart) encrypted file (secretfs mounted at /mnt/secretfs) has turned into a normal plaintext folder, all files that existed in the mounted encrypted file, are readable at /mnt/secretfs without having to open the encrypted file and mount it.


losetup


cryptsetup


mount


secretfs


/mnt/secretfs


/mnt/secretfs



This was unexpected and appears to make mounting an encrypted file insecure, I would appreciate any guidance to ensure that mounting an encrypted file always requries the passphrase to view it's contents and those contents are not copied to an unencrypted location.



Script


#!/bin/bash

set -e

# encrypted disk
dd of=secretfs bs=20G count=0 seek=8
chmod 600 secretfs
losetup /dev/loop0 secretfs
cryptsetup -y luksFormat /dev/loop0
cryptsetup luksOpen /dev/loop0 secretfs
cryptsetup status secretfs
mke2fs -j -O dir_index /dev/mapper/secretfs
tune2fs -l /dev/mapper/secretfs
mkdir /mnt/secretfs
mount /dev/mapper/secretfs /mnt/secretfs









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

437WD5 lpd464YFTYr NADsXGQOhcaHO1Smo82211N VY1502UIbAQ2bOz9jKSsw1,FHdp 6U1V GHEavL8IIOpgy,l
Hsa 1AH6,ZAlAg

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

Using generate_series in ecto and passing a value