passphrase

This commit is contained in:
Marc Beninca 2023-05-13 03:18:59 +02:00
parent 1f75f16a73
commit 9166e6ff45

View file

@ -97,7 +97,7 @@ function ovh-rescue-wipe-1-2TB {
local device='/dev/sda' local device='/dev/sda'
local unit='mib' local unit='mib'
# #
echo -n 'WIPE' "${device}" '/?\\ OR CANCEL /!\\' echo -n 'WIPE' "${device}" '/?\ OR CANCEL /!\'
read read
# #
parted "${device}" --script mktable gpt parted "${device}" --script mktable gpt
@ -117,20 +117,26 @@ function ovh-rescue-wipe-1-2TB {
mkfs.vfat -F 32 -n 'esp' '/dev/sda3' mkfs.vfat -F 32 -n 'esp' '/dev/sda3'
# format boot # format boot
mkfs.ext4 -L 'boot' '/dev/sda2' mkfs.ext4 -L 'boot' '/dev/sda2'
# read passphrase
local passphrase
read passphrase
# encrypt # encrypt
cryptsetup \ echo "${passphrase}" \
| cryptsetup \
--verbose \ --verbose \
--type luks2 \ --batch-mode \
--pbkdf argon2id \ --type 'luks2' \
--cipher aes-xts-plain64 \ --pbkdf 'argon2id' \
--cipher 'aes-xts-plain64' \
--iter-time 8192 \ --iter-time 8192 \
--key-size 512 \ --key-size 512 \
--hash sha512 \ --hash 'sha512' \
--use-random \ --use-random \
luksFormat \ luksFormat \
'/dev/sda1' '/dev/sda1'
# open # open
cryptsetup luksOpen '/dev/sda1' 'crypt' echo "${passphrase}" \
| cryptsetup luksOpen '/dev/sda1' 'crypt'
# pv # pv
pvcreate '/dev/mapper/crypt' pvcreate '/dev/mapper/crypt'
# vg # vg