LinuxCommandLibrary

ecryptfs-setup-swap

encrypted swap configuration

TLDR

Setup encrypted swap

$ ecryptfs-setup-swap
copy
Setup with specific swap partition
$ ecryptfs-setup-swap [/dev/sda2]
copy

SYNOPSIS

ecryptfs-setup-swap [device]

DESCRIPTION

ecryptfs-setup-swap configures encrypted swap space using dm-crypt with a random key. This prevents sensitive data from being recoverable from swap after shutdown.
The script modifies /etc/fstab and /etc/crypttab to enable encrypted swap on boot. A random key is generated each boot, so swap contents are unrecoverable after restart.
Encrypted swap is important when using encrypted home directories, as unencrypted swap could leak decrypted data.

PARAMETERS

DEVICE

Swap partition to encrypt.

CAVEATS

Disables hibernation (swap content unrecoverable). Requires root privileges. Existing swap will be reformatted. Must run with system not using swap.

HISTORY

ecryptfs-setup-swap is part of the eCryptfs utilities, addressing the security gap where encrypted filesystem data could leak to unencrypted swap space.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community