- Lab
- A Cloud Guru
Encrypting Storage Devices
In this hands-on lab, we will learn how to encrypt a storage medium, such as a USB stick or SD card. When a storage device is encrypted, no one can access the data on it without the correct key. That way, even if you lose the device, the data on the device will remain secret.
Path Info
Table of Contents
-
Challenge
Install the `cryptsetup` Utility
- Run the following command:
sudo yum install cryptsetup-luks
-
Challenge
Encrypt and Format the Storage Device
- List all of the available storage devices.
sudo fdisk -l
- Locate the device that is approximately 3 GB in size and has no partitions.
- Encrypt and format the device.
sudo cryptsetup -y -v luksFormat <DEVICE_NAME>
-
Challenge
Configure the Storage Device
- Open the device.
sudo cryptsetup luksOpen <DEVICE_NAME> LA
- Check the status of the device.
sudo cryptsetup -v status LA
- Find the header information for the device.
sudo cryptsetup luksDump <DEVICE_NAME>
- Clear the device.
sudo dd if=/dev/zero of=/dev/mapper/LA bs=128
- Create a filesystem on the device.
sudo mkfs.ext4 /dev/mapper/LA
- Create a new directory to serve as the mount point.
mkdir LA
- Mount the filesystem.
sudo mount /dev/mapper/LA LA/
-
Challenge
Unmount and Lock the Device
- Unmount the device.
sudo umount LA/
- Lock the device.
sudo cryptsetup luksClose LA
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.