You are currently viewing the United Kingdom version of the site.
Would you like to switch to your local site?
15 MIN READ TIME

LUKS

Dive into full-disk encryption on Linux

Stuart Burns covers the seemingly complex world of Linux disk encryption and reveals how to use it to secure your data.

Credit: //gitlab.com/cryptsetup

OUR EXPERT

Stuart Burns is a systems administrator for a large organisation and specialises in virtualisation, scripting and automation to solve problems and make everything as efficient as possible.

QUICK TIP

If you need more information on why something may not be working as expected in crypttab, there’s a switch that’ll give verbose output rather than the short amount it outputs. To use it, just insert the “-v” into any command that’s going to be run.

Everyone who uses disk encryption benefits from the security it provides, because once the information is compromised, it’s out there forever. Stolen unencrypted laptops are a treasure trove for the nosey or potential fraudster. Most modern Linux distributions make it very easy to turn on full disk encryption at installation time, but the installer can sometimes hide the more useful features in an effort to simplify the installation process. In this feature we’ll cover how to set up encryption, how the underlying encryption system works, how to use it, any potential pitfalls and how to avoid potential encryption disasters.

Before continuing further, it’s absolutely key to mention that some of the procedures mentioned here are destructive in nature. Therefore, ensure that there’s an appropriately tested backup before following along, and always exercise caution. It’s strongly recommended to experiment in a disposable virtual machine. For this tutorial we’re using Ubuntu 22.04 desktop in a VirtualBox VM with two disks. We suggest making the two disks different sizes – this will make it easier to differentiate between them.

Broadly speaking, disk encryption falls into two categories: file-based encryption and full disk encryption (FDE). File-based encryption, as the name suggests, encrypts on a per-file basis. The problem is that it’s extremely susceptible to incorrect use or bad management oversight (which files do you want to encrypt, have you deleted the unencrypted source files, and so on) and it can leave huge clues behind – even readable copies of the data in some instances – as well as meta data in non-encrypted log files and temporary files. In short, file-based encryption potentially leaves sensitive information unencrypted.

FDE, on the other hand, fully encrypts the partition or disk at the block level, negating these issues. All those logs and temporary files are fully encrypted and the system can’t even be booted or the disk mounted without the decryption password (a key in essence). Full disk encryption is also very light on modern systems with hardware-assisted encryption, and is almost transparent to the user once booted.

Unlock this article and much more with
You can enjoy:
Enjoy this edition in full
Instant access to 600+ titles
Thousands of back issues
No contract or commitment
Try for 99p
SUBSCRIBE NOW
30 day trial, then just £9.99 / month. Cancel anytime. New subscribers only.


Learn more
Pocketmags Plus
Pocketmags Plus

This article is from...


View Issues
Linux Format
November 2022
VIEW IN STORE

Other Articles in this Issue


LINUX FORMAT
MEET THE TEAM
We’re going retro mad this issue, so we asked our writing collective what’s their guilty-pleasure, nostalgic retrocomputing crush? No judgement here…
LINUX FORMAT
The #1 open source mag
WELCOME
To the rescue!
There’s a reason open source software is the
REGULARS AT A GLANCE
We salute Peter Eckersley, tech scientist and activist
THIS ISSUE: RIP Peter Eckersley Godot beta update Google bug bounty New Ubuntu app store New Framework laptop
Godot 4.0 hits beta
Open-source game engine reaches a major milestone.
Google bug bounty launched
The company is encouraging vulnerability reporting.
TIME TO MERGE
Donnie Berkholz is senior vice-president, product at Percona
WHAT A TO-DO!
Keith Edmunds is MD of Tiger Computer Ltd,
New app store for Ubuntu spotted
Canonical is ditching its Gnomebased store for Flutter.
Intel backs Krita
Intel becomes the first Gold Patron of the art program.
New Chromebook
Framework partners with Google to create $999 device.
Distro watch
What’s down the side of the free software sofa?
VIDEO CODECS
Benjamin Gaignard is a senior software engineer at
NO MOORE
Jon Masters is a kernel hacker who’s been
Kernel Watch
Jon Masters summarises the latest happenings in the Linux kernel, so that you don’t have to.
Answers
Got a burning question about open source or
Mailserver
WRITE TO US Do you have a burning
HotPicks
Sigil » Ventoy » Gopass » Videomass »
Sigil
Version: 1.9.10 Web: https://sigil-ebook.com
Ventoy
BOOTABLE USB CREATOR
Gopass
PASSWORD MANAGER
Videomass
VIDEO CONVERTER
Castero
PODCAST MANAGER
Borg
BACKUP APP
Glances
SYSTEM MONITOR
AWKTC
TETRIS
Battle for Wesnoth
STRATEGY GAME
Rymdport
FILE SHARING
dupeGuru
DUPLICATE FILE FINDER
PERFECT PRIVACY
Batten down your browsers! With our whole lives online its time to plug your leaky browser, utilise privacy extensions and try out the new Tor v12.
REVIEWS
Snapmaker 2.0 3-in-1
Who wants an expensive, jack-of-all-trades 3D printer, asks Denise Bertacchi?
RebornOS 10.2021
David Rutland’s mum ends every conversation with, “I use Arch BTW.” With RebornOS, she never even needed to open a terminal.
Openmamba 3.6.21
David Rutland was hoping for something of a snake theme with Openmamba. Instead, he got Red Hat with a KDE Plasma desktop.
MX Linux 21.2.1 KDE
David Rutland finds that ‘Wildflower,’ a Systemd-free, Plasma lovefest, seems to suffer from some recurring stability issues. It’s still good, though.
Salix 15.0
Salix OS is a willowy Slackware derivative that’s easy to use and comes with a well-themed Xfce desktop. Just what David Rutland’s looking for…
Two Point Campus
“You want job training?” laughs The Management at Fraser Brown, who knows deep down this is the closest he’ll get to a degree course…
ROUNDUP
Lightweight distros
EasyOS 4.3 Linux Lite 6.0 Lubuntu 22.04 Absolute Linux 15.0 4QOS 4.10 Gemini
Ease of installation
Did we have to jump through hoops to install and were there any extras?
Package management
Is it easy to add/remove software? How extensive are the repositories?
Rating the desktop environment
We review the front end to the system.
Memory and disk space
Low memory usage can help if a computer doesn’t have enough resources.
Live experience
In many scenarios, a working Linux set up on a flash drive can be a life-saver.
Ease of configuration
We want to see tools that are easy to use and intuitive while offering a good range of options.
Default applications
What’s the set of programs that the distro gives you from the get-go?
The Verdict
Lightweight distros
RETRO EMULATION
RETRO EMULATION
The Linux Format team all have their favourite retro memories, and Jonni Bidwell is here to regale y’all with them.
Relive past computers
A roundup of the computers that made us smile (and occasionally swear).
Retro gaming on the Pi
Set up RetroPie and set a course for nostalgic reverie.
Those magnificent machines of the 1980s
The eight-bit machines managed to do a huge amount with just a smidgeon of memory and CPUs that would faint looking at long division.
16-bit hits
For many, us included, the golden age of computing was characterised by the Amiga 500 or Atari ST.
Pi USER
CREATING MAYHEM IN 3D
Allie Katz runs Katz Creates, an online source
Astro Pi Mission Zero 2022/23 blasts off!
Getting the young ‘uns interested in coding with the help of space, the Raspberry Pi and physical projects.
Tom’s Hardware Pi Cast turns 100!
Get your live dose of Les Pounder and co each week.
Waveshare PoE USB Hub
Les Pounder always enjoys riding on the top deck of a double-decker bus. And this PoE HAT for the Zero is a double-decker bus for ants.
Khadas VIM4
This SBC outperforms the Raspberry Pi, but lacks its ecosystem. However, Les Pounder is too busy playing games to care…
Using the GPIO with Go
Les Pounder is ready to go! By which we mean he’s keen to try out the Google-developed alternative programming language to Python
IN DEPTH
LINUX IN WINDOWS
Step into the exciting world of Windows Subsystem for Linux and open source PowerShell, with Matthew Holder.
TUTORIALS
Keeping tabs on your internet usage
Shashank Sharma isn’t too keen on tracking calories, but he’s always interested in learning where his gigabytes of internet data goes…
Track down files and folders instantly
‘Work smarter, not harder’ advocate Nick Peers reveals how to use a tool to transform the way you search for files and folders on your PC.
Connect OnlyOffice with e-learning tools
With OnlyOffice Docs connected to your online learning solution, document editing and collaborating becomes a piece of cake, says Kseniya Fedoruk
Amiga OS comes back from the dead
Michael Reed take AROS for a spin – an open source, somewhat modernised re-implementation of the Amiga operating system.
Achieve the perfect setup for 3D printing
Spending a little time perfecting your printer setup is almost as important as the model creation process itself. Ali Jennings is here to help.
Run an ICL mainframe in your bedroom
Want to know what it was like to program an ICL mainframe? Mike Bedford spills the COBOL-based beans…
TOP OF THE FOSS!
IT’S GREAT WHEN YOU’RE K8S
Still scarred from his experiences trying to install Kubernetes at home, Jonni Bidwell turns to cloud native Alex Jones for support…
CODING ACADEMY
Use eBPF to keep tabs on your CPU
The ever-knowledgeable Mihalis Tsoukalos explains how to use eBPF and the tools of the BCC project to monitor your system’s processor.
Website and RSS feed Python scraping
Matt Holder investigates how to use Python to scrape information from a webpage and RSS feed, and perform some basic analysis.
Add selecting and printing file dialogs
Karsten Günther reveals how to save file names and paths, select them with YAD and print with the printer dialog.
Chat
X
Pocketmags Support