How to change the encryption password LUKS
It's great if you've decided to protect your data with LUKS. But you need to change if you have chosen an inappropriate passphrase. Fortunately, unlike many encryption solutions, LUKS allows to change passphrases quite easily. However, this is not a solution for losing a passphrase, because you need to know the passphrase earlier. In general, this is just an effective way to change or remove inappropriate old passphrases.
Change the passphrase for LUKS
Changing the passphrase on LUKS drive only has a single passphrase extremely easily. Open the terminal and run the following command, replacing 'sdX' with the actual drive location. First, you will be prompted to enter an existing passphrase. Then you can create a new passphrase.
sudo cryptsetup luksChangeKey /dev/sdX
LUKS drive with many passphrases
LUKS drives can have multiple passphrases or main files associated with them, up to 8 passphrases. To get started, check your LUKS drive and see how many keys it has. Chances are, you will only see key slot 0 . That was the first key.
sudo cryptsetup luksDump /dev/sdX | grep -i key
If there are empty slots open, you can always add another passphrase to your drive. Run the following command and a new key will be added to the first blank slot.
sudo cryptsetup luksAddKey /dev/sdX
When you have to manage multiple keys on the same drive, you will need the ability to target specific keys. Again, you can do it quite simply with the -S flag . Just add the number of slots after the -S flag and select a key to change.
sudo cryptsetup luksChangeKey /dev/sdX -S 2
Delete the passphrase
When working with multiple keys, you may sometimes need to delete the old keys. There are several ways that LUKS allows you to handle this. The easiest way is to use the integrated command to delete the key and LUKS will prompt you to enter a passphrase. LUKS will automatically delete the key associated with the passphrase you entered.
sudo cryptsetup luksRemoveKey /dev/sdX
In case you want to specify yourself, you can use the KillSlot command to delete the key located in a certain slot. Just include the number of drive and key slots on that slot will be deleted.
sudo cryptsetup luksKillSlot /dev/sdX 2
Whichever way you choose to manage your LUKS passphrase, you will find that it is one of the most flexible encryption options available. Because LUKS allows to change, manage and delete keys, you can add new security layers to your drive. LUKS also allows you to control access for a group of people, instead of just you.
Hope you are succesful.
You should read it
- Multi-level SSD: SLC, MLC, TLC, QLC and PLC?
- 8 other uses of external hard drives/NAS besides file storage
- 12 USB drives can keep your data safe
- Looking back on 60 years of miraculous development of hard drives today
- How to Remove Autorun Virus from Hard Disk Drives
- Ransomware can encrypt cloud data
- What is a NAS hard drive? What is a Surveillance Hard Drive?
- How to delete virtual drives on Windows 10?
May be interested
- Set password, password protect USB data safelyset password, password protect usb data securely with bitlocker or usb flash security software.
- How to change Wifi password, change wifi pass VNPT, FPT, Tenda, TP-Link, Viettel on computer, phonechanging this wifi password will make it easier to change wifi passwords, increase wifi security. here is a summary of how to change wifi pass for the most popular modems, such as: fpt, tenda, tp-link, viettel, please refer.
- Instructions to change Garena password quickly and easilyinstructions on 3 fastest and simplest ways to change garena passwords for gamers, along with tips on how to safely change garena passwords. this will help your account avoid being deleted.
- Instructions to change Facebook password on computerto enhance the security layer for facebook accounts, you should choose the password range with unpredictable characters from the moment you create the account. and if you choose the password you are using at a high level of security, you should change your facebook password.
- How to change FPT WiFi passwordchanging fpt wifi password or changing wifi wifi will help block unwanted access. if you do not know how to change fpt wifi password, please refer to this tutorial.
- Instructions for changing Windows passwords without having to remember the old passwordsuppose in case you want to change your windows computer password but forget the old password. or suppose you want to log into a user's computer .... you can easily use the command prompt to change the old password.
- How to change a travel suitcase password with a numeric locksuitcase is the indomitable object of each person when traveling. in the suitcase not only for essential items but sometimes also work documents that need to be safe. therefore, suitcases with passwords are always the first choice.
- What is end-to-end encryption? How does it work?online privacy is the need of the times. especially when there is a continuous increase in the number of techniques to steal user data.
- Instructions to change Garena password on the phoneto protect your account in the best way, users should change garena password regularly to avoid forgetting your password and help you strengthen your account security. so how to change garena password on the phone? please read the following detailed instructions.
- How to change Zalo password on the phoneto secure zalo account, users should change the password after creating zalo account. especially the use of difficult-to-guess character sequences will increase the security of your zalo account.