Refer to the cryptsetup-luksChangeKey
man page --key-file
options, you cannot change the password directly on a commandline; you either (a) type it interactively, (b) put it in a keyfile, or (c) accept input from STDIN with the standard use of -
on the end (e.g. echo "mypass" | cryptsetup luksChangeKey /dev/sda -
)
The correct syntax is cryptsetup luksChangeKey <device> <key file>
. So what you tried is opening a file that is named like your new passphrase. Such a file of course (hopefully) doesn't exist.
Just omit the last parameter, i.e. sudo cryptsetup luksChangekey /dev/nvme0n1p3
and enter the new password when it asks you to.
What is the output if you run sudo cryptsetup --verbose open --test-passphrase /dev/nvme0n1p3
?
It asks for the sudo password, then it prints
No usable token is available.
Then it asks : Enter passphrase for /dev/nvme0n1p3:
After entering my old passphrase it prints:
Key slot 0 unlocked
Command Successful.
Alright so no permission issue, what if you run the changekey command in a separate bash subprocess? sudo bash -c '($your-changekey-command-here)'
Is it like the same first "cryptsetup luksChangekey..." But inside parentheses ? Im sure I'm getting the syntax wrong.. It prints
bash: line 1: -luksChangekey: command not found
Have you tried using GNOME Disk Utility?
I have it installed, but I don't see the option 🤷♂️
Try clicking on the encrypted partition to get the passphrase option.
https://askubuntu.com/questions/95137/how-to-change-luks-passphrase
Here's how to find it: https://spectra.video/w/tbLNakrf2ncii4NrqJbwE8
OMG, thank youu.. It worked.. 🥳
Linux Questions
Linux questions Rules (in addition of the Lemmy.zip rules)
- stay on topic
- be nice (no name calling)
- do not post long blocks of text such as logs
- do not delete your posts
- only post questions (no information posts)
Tips for giving and receiving help
- be as clear and specific
- say thank you if a solution works
- verify your solutions before posting them as facts.
Any rule violations will result in disciplinary actions