Changing a LUKS Passphrase

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

In this hands-on lab, we will learn how to safely change the passphrase used on a LUKS-encrypted volume without losing the data on the volume. LUKS passphrases should be changed on a regular schedule, just like account passwords.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Change the LUKS-Encrypted Volume Passphrase
  1. We first need to identify what volume patient_lv is part of. When a LUKS-encrypted volume is created, its original name includes the volume group name. Run the following command, and look for device in the output:
    sudo cryptsetup -v status patient_lv
  2. Run the following command to change the passphrase:
    sudo cryptsetup luksChangeKey /dev/mapper/luks_vg-patient_lv
  3. Enter the original passphrase (Pinehead1!) at the prompt.
  4. Enter the new passphrase (Waddle4thewin!) at the prompt.
  5. Re-enter the new passphrase (Waddle4thewin!) to confirm.
Add a File Named `test.txt` to the LUKS-Encrypted Volume
  1. Determine where the patient_lv logical volume is mounted.
    df -h
  2. Change to the /data directory.
    cd /data
  3. Create a new file called touch.txt.
    touch /data/test.txt

Additional Resources

As a part of your security program's policies, all LUKS passphrases are to be changed every 6 months. You've been tasked with changing the LUKS passphrase for the patient_lv logical volume on a Red Hat 7 host. The old passphrase is Pinehead1!. The new passphrase needs to be Waddle4thewin!. No data should be lost during the passphrase change process. After the change has been made, create a file named test.txt on the volume to ensure it is still functional.

What are Hands-on Labs

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.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!