Last active
September 6, 2023 03:29
-
-
Save jsgoyette/d03546e0adbcf246cd9f0a9c6eb92fe3 to your computer and use it in GitHub Desktop.
Create encrypted volume file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# derived from: https://opensource.com/article/21/4/linux-encryption | |
# create empty file | |
dd if=/dev/urandom of=vaultfile.img bs=1M count=512 | |
# create LUKS volume | |
cryptsetup --verify-passphrase luksFormat vaultfile.img | |
# open the LUKS volume | |
sudo cryptsetup open --type luks vaultfile.img vault | |
ls /dev/mapper | |
# create a filesystem | |
sudo mkfs.ext4 -L vault /dev/mapper/vault | |
# start the volume | |
sudo cryptsetup open --type luks vaultfile.img vault | |
sudo mkdir ~/vault | |
sudo mount /dev/mapper/vault ~/vault | |
# first time permissions | |
sudo chown jsgoyette:jsgoyette ~/vault | |
# close the system | |
sudo umount ~/vault | |
sudo cryptsetup close vault |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment