Created
June 21, 2021 14:49
-
-
Save jordiclariana/8925055445ce7cd29e8f7af58643e3fc to your computer and use it in GitHub Desktop.
changeDiskEncryptionPassphrase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$(id -u)" != "0" ]; then | |
echo "Run this script as root" | |
exit 1 | |
fi | |
UUID=$(sed -r 's#^.*_crypt UUID=([^ ]+) none.*#\1#' /etc/crypttab | head -n1) | |
sudo cryptsetup luksChangeKey "/dev/disk/by-uuid/$UUID" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment