Skip to content

Instantly share code, notes, and snippets.

@jordiclariana
Created June 21, 2021 14:49
Show Gist options
  • Save jordiclariana/8925055445ce7cd29e8f7af58643e3fc to your computer and use it in GitHub Desktop.
Save jordiclariana/8925055445ce7cd29e8f7af58643e3fc to your computer and use it in GitHub Desktop.
changeDiskEncryptionPassphrase
#!/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