MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
November
Sun Mon Tue Wed Thu Fri Sat
           
20 21 22
23 24 25 26 27 28 29
30            
2025
Months
NovDec


Wed, Nov 19, 2025 3:35 pm

Changing the password for a LUKS encrypted partition on Linux

If you need to change the password, i.e., the encryption key, used to encrypt a partition with Linux Unified Key Setup (LUKS) on a Linux system, you can open a terminal window and use the command sudo cryptsetup luksChangeKey /dev/sdaX where sdaX is the relevant partition. E.g., I needed to change the password on a Ubuntu Linux system where the user's data was stored on /dev/sda3.

jim@Firefly:~$ sudo cryptsetup luksChangeKey /dev/sda3
Enter passphrase to be changed:
Enter new passphrase:
Verify passphrase:
jim@Firefly:~$

If you don't know the designation for the encrypted partition, e.g., if I didn't know it was sda3, I could use the lsblk command (it is part of the util-linux package) to determine it. E.g.:

jim@Firefly:~$ lsblk
NAME                      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0                       7:0    0     4K  1 loop  /snap/bare/5
loop1                       7:1    0  73.9M  1 loop  /snap/core22/2133
loop2                       7:2    0  11.8M  1 loop  /snap/desktop-security-center/59
loop3                       7:3    0 247.6M  1 loop  /snap/firefox/6966
loop4                       7:4    0  11.1M  1 loop  /snap/firmware-updater/167
loop5                       7:5    0  91.7M  1 loop  /snap/gtk-common-themes/1535
loop6                       7:6    0  14.4M  1 loop  /snap/prompting-client/104
loop7                       7:7    0 516.2M  1 loop  /snap/gnome-42-2204/226
loop8                       7:8    0  17.5M  1 loop  /snap/snap-store/1300
loop9                       7:9    0  50.8M  1 loop  /snap/snapd/25202
loop10                      7:10   0   576K  1 loop  /snap/snapd-desktop-integration/315
loop11                      7:11   0 226.2M  1 loop  /snap/thunderbird/812
sda                         8:0    0 953.9G  0 disk
├─sda1                      8:1    0     1G  0 part  /boot/efi
├─sda2                      8:2    0     2G  0 part  /boot
└─sda3                      8:3    0 950.8G  0 part
  └─dm_crypt-0            252:0    0 950.8G  0 crypt
    └─ubuntu--vg-ubuntu--lv
                          252:1    0 950.8G  0 lvm   /
jim@Firefly:~$

From the above output, I can see that the disk drive in the system is designated as sda and the encrypted partition is sda3 (it is listed as type "crypt").

[ More Info ]

[/security/encryption/LUKS] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo