Luks
De Linuxmemo.
(Différences entre les versions)
		
		
 (→Automatime)  | 
		 (→Automatime)  | 
		||
| Ligne 43 : | Ligne 43 : | ||
  /dev/mapper/sdb1_crypt /backup               ext4    errors=remount-ro 0       1  |   /dev/mapper/sdb1_crypt /backup               ext4    errors=remount-ro 0       1  | ||
| - | ==  | + | ==Automatisme==  | 
  cryptdisks_start labelvolume  |   cryptdisks_start labelvolume  | ||
  cryptdisks_stop labelvolume  |   cryptdisks_stop labelvolume  | ||
Version du 28 janvier 2020 à 09:37
LUKS, pour Linux Unified Key Setup (sous Linux:cryptsetup, utilisant dm-crypt)
Sommaire | 
Initialisation
Creation d'une partition type "83 linux":
Lsblk fdisk /dev/sdb o n p w
Initialisation du chiffrement:
cryptsetup luksFormat /dev/sdb1
Mappage de la partition avec "device-mapper" et le module "crypt":
cryptsetup open /dev/sdb1 sdb1-crypt
Formatage de la partition:
mkfs.ext4 -L backup-crypt /dev/mapper/sdb1-crypt
Démontage propre:
cryptsetup close /dev/mapper/sdb1-crypt
utilisation manuelle
cryptsetup open /dev/sdb1 sdb1-crypt mount /dev/mapper/sdb1-crypt /backup
Auto mount
Savoir si il existe déjà une cle
cryptsetup luksDump /dev/sdb1
Créer un fichier cle
dd if=/dev/random bs=32 count=1 of=/etc/lukskey xxd /etc/lukskey
Ajouter la cle au disque /partition
cryptsetup luksAddKey /dev/sdb1 /etc/lukskey
lier la cle au disque /partition
vim etc/crypttab sdb1_crypt UUID=658e8adb-778a-4bd6-b636-a0c5f7b353bb /etc/lukskey luks,discard
Montage automatique
vim /etc/fstab /dev/mapper/sdb1_crypt /backup ext4 errors=remount-ro 0 1
Automatisme
cryptdisks_start labelvolume cryptdisks_stop labelvolume
lit le fichier "/etc/crypttab"
- The first field, "target, describes the mapped device name"
 - The second field, source device UUID=<luks_uuid> - cryptsetup luksDump /dev/sdb1|grep uuid
 - The third field, key file or "none"
 - The fourth field, options