Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- dd if=/dev/urandom of=/boot/keyfile bs=1024 count=4
- chmod 0400 /boot/keyfile
- cryptsetup -v luksAddKey /dev/sda3 /boot/keyfile
- ls -l /dev/disk/by-uuid/
- root@quangva-Vostro-3459:/home/quangva# ls -l /dev/disk/by-uuid/
- total 0
- lrwxrwxrwx 1 root root 10 Thg 1 8 14:35 26D4-3645 -> ../../sda1
- lrwxrwxrwx 1 root root 10 Thg 1 8 14:35 4c4f6b87-66c1-495b-9dfd-a5eff8ffd032 -> ../../dm-1
- lrwxrwxrwx 1 root root 10 Thg 1 8 14:35 7c229c4a-d978-446f-ae1c-ad3e28ce30df -> ../../sda2
- lrwxrwxrwx 1 root root 10 Thg 1 8 14:35 87b0cbb3-907c-4ea6-a3a5-0731c72c478b -> ../../sda3
- lrwxrwxrwx 1 root root 10 Thg 1 8 14:35 88d8ded4-03e4-4e74-89ba-9ea9d560309d -> ../../dm-2
- vi /etc/crypttab
- sda3_crypt UUID=87b0cbb3-907c-4ea6-a3a5-0731c72c478b none luks,discard
- sda3_crypt UUID=87b0cbb3-907c-4ea6-a3a5-0731c72c478b /dev/disk/by-uuid/7c229c4a-d978-446f-ae1c-ad3e28ce30df:/keyfile luks,keyscript=/lib/cryptsetup/scripts/passdev
- update-initramfs -u
- mkinitramfs -o /boot/initrd.img-$(uname -r) $(uname -r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement