ecryptfs-setup-swap
Encrypt swap partition during system setup
SYNOPSIS
ecryptfs-setup-swap [options]
PARAMETERS
-f, --force
Force the setup of encrypted swap, even if existing swap partitions are detected or other conditions might normally prevent the process. Use with caution as it can overwrite existing configurations.
DESCRIPTION
The ecryptfs-setup-swap command automates the process of creating and configuring encrypted swap space on a Linux system. This is particularly crucial for systems utilizing eCryptfs for home directory encryption, as it prevents sensitive data from being written unencrypted to disk when the system's RAM is fully utilized and data is swapped out. The command typically creates a dedicated swap file, encrypts it using dm-crypt (device mapper crypt), and then configures the system to use this encrypted swap space on boot. It ensures that any data leaving RAM for swap is always encrypted, thus mitigating the risk of sensitive information leakage through forensic analysis of the swap partition/file. It's an essential security measure for maintaining data privacy on systems with encrypted user data.
CAVEATS
Kernel Modules: Requires the dm-crypt kernel module and related cryptographic modules to be loaded and functional.
Performance Impact: Encryption and decryption overhead can lead to a slight performance degradation when heavy swapping occurs.
Disk Space: Requires sufficient free disk space to create the encrypted swap file. The size of the swap file is often determined by the system's RAM or user input.
Key Management: The encrypted swap key is typically generated randomly at boot and discarded on shutdown, providing strong forward secrecy for swap data. This means swap contents are not persistent across reboots.
System Configuration: Modifies system configuration files like /etc/crypttab and /etc/fstab. Manual intervention might be required if these files are custom-configured or if issues arise.
HISTORY
The ecryptfs-setup-swap command is part of the ecryptfs-utils package, which provides utilities for managing eCryptfs encrypted filesystems. eCryptfs itself was initially developed by IBM and later adopted by various Linux distributions, most notably Ubuntu, for its encrypted home directory feature. This command emerged as a critical component to address the security vulnerability of unencrypted swap space when using eCryptfs for user data, ensuring end-to-end data confidentiality on disk.
SEE ALSO
ecryptfs-mount-private(1), ecryptfs-unwrap-passphrase(1), swapon(8), swapoff(8), cryptsetup(8), fstab(5), crypttab(5)