Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on adding the advanced luks article to the password article #1166

Merged
merged 11 commits into from
Dec 14, 2023
60 changes: 55 additions & 5 deletions content/password.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Change User Password
title: Change User Password and LUKS Passphrase
description: >
Forgot your main password? Locked out of your computer? Need to change your encryption passphrase? Follow these instructions to change both!
keywords:
Expand All @@ -18,9 +18,11 @@
tableOfContents: true
---

## Changing user password

If you can't log into your computer, you can follow these instructions to reset the password for any user. Pop!_OS and Ubuntu allow for the root user to reset the password for any user account. In order to get to the root user, we need to restart the computer and use what's called "single user mode", which is the low level repair system for the computer.

## Pop!_OS 18.04 and Later
### Pop!_OS 18.04 and Later

On a fresh install Pop!_OS 18.04 and later, <u>systemd-boot</u> is used rather than <u>GRUB</u>. Please follow these instructions to reset your password. If your operating system is anything other than Pop!_OS 18.04 and later, please use the [GRUB](#grub) section.

Expand All @@ -30,11 +32,11 @@

Once the recovery operating system boots, close out of the installation window or choose **“try demo mode”** (be sure not to choose any install or repair options, as this could result in data loss).
ahoneybun marked this conversation as resolved.
Show resolved Hide resolved

## Ubuntu
### Ubuntu

If you are using Ubuntu we can boot from a live disk and [here](/articles/live-disk) are instructions for creating the live disk. Once the live disk has been created refer to this [article](/articles/boot-menu) for booting from the live disk.

## Mounting the Installed OS
#### Mounting the Installed OS

Press <kbd><font-awesome-icon :icon="['fab', 'pop-os']"></font-awesome-icon></kbd>/<kbd><font-awesome-icon :icon="['fab', 'ubuntu']"></font-awesome-icon></kbd>+<kbd>T</kbd> to open a terminal, and type in these commands:
ahoneybun marked this conversation as resolved.
Show resolved Hide resolved

Expand Down Expand Up @@ -84,4 +86,52 @@
reboot
```

Now, enter the original passphrase. Here you will be prompted for the new passphrase, and then to confirm the new passphrase.
## Changing LUKS passphrase

If you would like to change the password on a LUKS encrypted partition, run this command (replace the example partition with your root partition):

```bash
cryptsetup luksChangeKey /dev/sda3 -S 0
```

Enter the original pass-phrase, and follow the prompts for the new pass-phrase ( and to confirm the new pass-phrase).

## Adding LUKS passphrases

Full Disk Encryption supports up to 8 total pass-phrases to unlock the encryption. This is useful if you would like to allow more than a single user to unlock the encryption and not share a pass-phrase. The default pass-phrase is in slot 0, with space for additional pass-phrases in slots 1 through 7 (for a total of 8).

Check failure on line 101 in content/password.md

View workflow job for this annotation

GitHub Actions / Lint (Markdown)

Trailing spaces [Expected: 0 or 2; Actual: 1]

### List Partitions

First let's list the partitions of all of the installed drives:

```
lsblk -f
XV-02 marked this conversation as resolved.
Show resolved Hide resolved
ahoneybun marked this conversation as resolved.
Show resolved Hide resolved
```

The output may be different based on the drive setup and partition table. You can see the root partition at mountpoint '/'. From there we can use that output to run this command:

```
sudo cryptsetup luksDump /dev/sda3
ahoneybun marked this conversation as resolved.
Show resolved Hide resolved
```

Replacing '/dev/sda3' with the location of the root partition on your system. With the output of this command we can see the seven extra slots that we have for passwords to decrypt the drive. On a normal install Slots 1-7 are the open, with Slot 0 as the initial pass-phrase.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit odd:

On a normal install Slots 1-7 are the open, with Slot 0 as the initial pass-phrase.

I feel like it would be like this:

On a normal install Slots 1-7 are not used and Slot 0 is used as the initial pass-phrase.


#### Set Extra Password

Following the partition scheme from the previous command we can form the next command to add a new key to the open Key Slot:

```
sudo cryptsetup luksAddKey /dev/sda3
```

This command will require the current encryption password before new password can be added.

#### Confirm The Password

Let's run this command again to confirm that the additional pass-phrase is set:

```
sudo cryptsetup luksDump /dev/sda3
```

You should see that Key Slot 1 is now enabled so this confirms the new pass-phrase is set.
Binary file modified static/images/password/systemd-boot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading