A set of scripts that simplify the creation, mounting, and management of DM-Crypt encrypted containers with enhanced safety checks and automation.
Additional mount scripts for DM-Crypt containers
This tool is designed for users who need to easily create and manage encrypted containers using DM-Crypt, especially in environments like LiveCDs where quick mounting is essential. It streamlines multiple commands into a single script, making encryption management accessible for system administrators and security-conscious users.
The tool requires root or sudo privileges to manage encrypted containers. It is recommended to configure sudoers rules for safer non-root usage. The script performs multiple safety checks to avoid data loss by preventing operations on mounted or RAID/LVM/ZFS devices. Users should ensure all dependencies are installed and use strong passphrases for encryption security.
Ensure required programs are installed: cryptsetup, sed, basename, realpath, losetup, dd, mkfs*, shred, touch, bash
On some systems, manually install cryptsetup (e.g., 'apt-get install cryptsetup-bin' on Ubuntu 18 minimal)
Optionally install sudo and filesystem support tools (btrfs, xfs, ntfs, exfat, reiserfs)
Download the script to a local directory, e.g., '/opt' using wget or curl: 'wget https://github.com/Aminuxer/DM-Crypt-Helper-Scripts/raw/master/_dmc.sh'
Make the script executable: 'chmod +x _dmc.sh'
Optionally create sudoers rules to allow non-root users to run the script without password
Run the script with sudo: 'sudo /opt/_dmc.sh'
./_dmc.sh <Path to Dm-Crypt container> create
Creates a new DM-Crypt container in a file or block device with interactive prompts
./_dmc.sh <Path to Dm-Crypt container>
Mounts or switches to the specified DM-Crypt container
./_dmc.sh <Path to Dm-Crypt container> stop
Forces unmounting and stopping of the specified DM-Crypt container
./_dmc.sh make_loops
Creates new loop devices in /dev for container use
sudo /opt/_dmc.sh
Runs the script with sudo privileges, showing mini-help if no parameters are given