Guest User

Untitled

a guest
Jul 21st, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. # wipe the disk
  2. wipefs –a /dev/sda
  3. parted /dev/sda mklabel gpt
  4. parted /dev/sda mkpart logical ext4 0% 100%
  5. mkdir /mnt/usb
  6. cryptsetup luksFormat /dev/sda1 # type YES and then enter a password
  7. dd if=/dev/urandom of=/root/keyfile bs=1024 count=4
  8. chmod 0400 /root/keyfile
  9. cryptsetup luksAddKey /dev/sda1 /root/keyfile #Enter passphrase
  10. cryptsetup open /dev/sda1 encrypted
  11. # create new ext4 filesystem
  12. mkfs.ext4 /dev/mapper/encrypted
  13. echo encrypted /dev/sda1 /root/keyfile luks >> /etc/crypttab
  14. echo /dev/mapper/encrypted /mnt/usb ext4 defaults 0 2 >> /etc/fstab
  15. mount /mnt/usb
  16. # depending on your system, you may need to update your initramfs at this point
  17. reboot
Add Comment
Please, Sign In to add comment