Parcourir la source

Mise à jour 20250920

lauhub il y a 2 mois
Parent
commit
fbb5fbbaa7

+ 11 - 0
base-de-connaissances.code-workspace

@@ -0,0 +1,11 @@
+{
+	"folders": [
+		{
+			"path": "."
+		}
+	],
+	"settings": {
+		"workbench.colorTheme": "Visual Studio Light",
+		"workbench.preferredDarkColorTheme": "Liver Purple Full with Semantic Highlighting"
+	}
+}

+ 38 - 25
gnu-linux/partitionnement/swap-chiffre.md

@@ -5,7 +5,7 @@ Il est possible de combiner un chiffrement **non persistant** avec un swap répa
 
 ## Configuration d'un swap chiffré non persistant sur plusieurs partitions
 
-### **1. Désactiver les swaps existants**
+### Désactiver les swaps existants
 
 Avant de configurer le nouveau swap, désactivez toutes les partitions swap actuellement actives :
 
@@ -13,42 +13,55 @@ Avant de configurer le nouveau swap, désactivez toutes les partitions swap actu
 sudo swapoff -a
 ```
 
-### **2. Chiffrer chaque partition de manière non persistante**
+### Chiffrer chaque partition de manière non persistante
 
-Pour chaque partition de swap (par exemple `/dev/sdb1`, `/dev/sdc1`, `/dev/sdd1`), configurez un chiffrement non persistant avec **dm-crypt**.
+Pour chaque partition de swap (par exemple `/dev/sda2`, `/dev/sdb2`, `/dev/sdc2`), configurez un chiffrement non persistant avec **dm-crypt**.
 
-#### Exemple pour une partition `/dev/sdb1` :
+#### Exemple pour une partition `/dev/sda2` :
 
-1. **Créer une couche de chiffrement temporaire :**
-   ```bash
-   sudo cryptsetup open --type plain --cipher aes-xts-plain64 --key-file /dev/urandom /dev/sdb1 cryptswap1
-   ```
-   - **`--type plain`** : Utilise un chiffrement simple (sans métadonnées).
-   - **`--cipher aes-xts-plain64`** : Définit l'algorithme de chiffrement (AES avec XTS, souvent recommandé pour les performances).
-   - **`--key-file /dev/urandom`** : Génère une clé aléatoire à chaque démarrage.
-2. **Formater le périphérique mappé en swap :**
-   ```bash
-   sudo mkswap /dev/mapper/cryptswap1
-   ```
-3. **Activer le swap :**
-   ```bash
-   sudo swapon /dev/mapper/cryptswap1
-   ```
-4. **Répétez les étapes 1 à 3 pour chaque partition** (par exemple `/dev/sdc1`, `/dev/sdd1`), en remplaçant `cryptswap1` par des noms uniques comme `cryptswap2`, `cryptswap3`, etc.
+1. Créer une couche de chiffrement temporaire :
+
+```bash
+sudo cryptsetup open --type plain --cipher aes-xts-plain64 --key-file /dev/urandom /dev/sda2 cryptswapa
+```
+
+- **`--type plain`** : Utilise un chiffrement simple (sans métadonnées).
+- **`--cipher aes-xts-plain64`** : Définit l'algorithme de chiffrement (AES avec XTS, souvent recommandé pour les performances).
+- **`--key-file /dev/urandom`** : Génère une clé aléatoire à chaque démarrage.
+
+2. Formater le périphérique mappé en swap :
+
+```bash
+sudo mkswap /dev/mapper/cryptswapa
+```
+
+3. Activer le swap :
+
+```bash
+sudo swapon /dev/mapper/cryptswap1
+```
+
+4. Répétez les étapes 1 à 3 pour chaque partition
+ 
+Les noms doivent être uniques `cryptswap1`, `cryptswap2`, etc.
+
+Par exemple :
 
+- `/dev/sdb2` pour créer `cryptswapb`
+- `/dev/sdc2` pour créer `cryptswapc`
 
-### **3. Ajouter une configuration automatique (optionnelle)**
+### Ajouter une configuration automatique (optionnelle)
 
 Pour automatiser cette configuration au démarrage, modifiez les fichiers suivants :
 
-#### **Dans `/etc/crypttab` :**
+#### Dans `/etc/crypttab` :
 
 Ajoutez une ligne pour chaque partition swap chiffrée, comme suit :
 
 ```plaintext
-cryptswap1 /dev/sdb1 /dev/urandom cipher=aes-xts-plain64,size=256
-cryptswap2 /dev/sdc1 /dev/urandom cipher=aes-xts-plain64,size=256
-cryptswap3 /dev/sdd1 /dev/urandom cipher=aes-xts-plain64,size=256
+cryptswapa /dev/sda2 /dev/urandom cipher=aes-xts-plain64,size=256
+cryptswapb /dev/sdb2 /dev/urandom cipher=aes-xts-plain64,size=256
+cryptswapc /dev/sdc2 /dev/urandom cipher=aes-xts-plain64,size=256
 ```
 
 #### **Dans `/etc/fstab` :**

+ 36 - 0
gnu-linux/serveurs/installation/proxmox-maison.md

@@ -0,0 +1,36 @@
+% Installation d'une Box proxmox
+
+
+Nécessité de réserver une partition en ZFS pour le TPM
+
+
+[How to Fix (Workaround) Proxmox VE (PVE) with TPM 2.0 can’t have snapshots “The current guest configuration does not support taking new snapshots”](https://dannyda.com/2021/10/19/how-to-fix-workaround-proxmox-ve-pve-with-tpm-2-0-cant-have-snapshots-the-current-guest-configuration-does-not-support-taking-new-snapshots/)
+
+
+
+Création du lvgroup
+
+Après avoir fait lvresize sur /var pour gagner 300Mo en mode rescue
+
+```bash
+# lvresize --resizefs --size SIZE /dev/vg/vg_data
+```
+
+[Shrinking an Ext4 File System on LVM in Linux - SysTutorials](https://www.systutorials.com/shrinking-a-ext4-file-system-on-lvm-in-linux/)
+
+
+
+```bash
+lhbox:~# lvcreate -L 40G -n tpm lhbox-vg
+  Logical volume "tpm" created.
+lhbox:~# lvconvert --type thin-pool /dev/lhbox-vg/tpm 
+  Thin pool volume with chunk size 64.00 KiB can address at most <15.88 TiB of data.
+  WARNING: Converting lhbox-vg/tpm to thin pool's data volume with metadata wiping.
+  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
+Do you really want to convert lhbox-vg/tpm? [y/n]: y
+  Converted lhbox-vg/tpm to thin pool.
+```
+
+
+Puis créer un LVM-thin dans Datacenter > Storage
+

+ 111 - 26
gnu-linux/serveurs/installation/serveur-deux-disques.md

@@ -21,7 +21,7 @@ Tuto à refaire: on va partir en RAID0 car plus simple pour un déchiffrement en
 
 ## Partition de boot
 
-On crée une partition de boot uniquement sur le premier disque: 512 Mo
+On crée une partition de boot sur les deux disques: 512 Mo
 
 ## *Swap*
 
@@ -154,47 +154,132 @@ Syncing disks.
 
 ## Partitionnement du second disque
 
-Cette fois, on ne crée que deux partitions:
+On fait un dump du disque précédent:
 
-- une Swap de `+24117248` secteurs
-- une principale sur le reste du disque
+```bash
+sfdisk --dump /dev/sda  > sda.dump
+```
 
 ```bash
-fdisk /dev/sdb
+# cat sda.dump
+label: gpt
+label-id: F4C65904-AE36-9840-8A8E-896F80BB3E44
+device: /dev/sda
+unit: sectors
+first-lba: 2048
+last-lba: 3907029134
+sector-size: 512
+
+/dev/sda1 : start=        2048, size=     1048576, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=28EE3FC6-31D0-9940-AE6D-747516CA9E60
+/dev/sda2 : start=     1050624, size=    24117249, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=4112F137-A11E-434B-A6FF-A8BB94479F62
+/dev/sda3 : start=    25169920, size=  3881859072, type=E6D6D379-F507-44C2-A23C-238F2A3DF928, uuid=1E816DE5-C4FE-594A-9577-E5617373F36A
 ```
 
+On duplique vers le second disque :
+
+```bash
+sfdisk /dev/sdb < sda.dump
 ```
-Command (m for help): g
-Created a new GPT disklabel (GUID: EB07A51E-0F98-0949-8126-E55071DD5879).
 
-Command (m for help): n
-Partition number (1-128, default 1): 
-First sector (2048-3907029134, default 2048): 
-Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-3907029134, default 3907028991): +24117248
+# Chiffrement
 
-Created a new partition 1 of type 'Linux filesystem' and of size 11.5 GiB.
+Voir [Chiffrement sur cette page](gnu-linux/serveurs/installation/ecaz-serveur-proxmox.md)
 
-Command (m for help): t
-Selected partition 1
-Partition type or alias (type L to list all): 19
-Changed type of partition 'Linux filesystem' to 'Linux swap'.
+## Chiffrement des swap
 
-Command (m for help): n
-Partition number (2-128, default 2): 
-First sector (24119297-3907029134, default 24121344): 
-Last sector, +/-sectors or +/-size{K,M,G,T,P} (24121344-3907029134, default 3907028991): 
+```bash
+swapoff -a
+cryptsetup open --type plain --cipher aes-xts-plain64 --key-file /dev/urandom /dev/sda2 cryptswapa
+cryptsetup open --type plain --cipher aes-xts-plain64 --key-file /dev/urandom /dev/sdb2 cryptswapb
+mkswap /dev/mapper/cryptswapa 
+mkswap /dev/mapper/cryptswapb
+swapon /dev/mapper/cryptswapb
+swapon /dev/mapper/cryptswapa
+```
 
-Created a new partition 2 of type 'Linux filesystem' and of size 1.8 TiB.
+# Configuration du RAID
 
-Command (m for help): t
-Partition number (1,2, default 2): 
-Partition type or alias (type L to list all): 43
+## Partitions de démarrage
 
-Changed type of partition 'Linux filesystem' to 'Linux LVM'.
+On se met en RAID1
 
-Command (m for help): w
+```bash
+# mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sd[a-b]1
+mdadm: Note: this array has metadata at the start and
+    may not be suitable as a boot device.  If you plan to
+    store '/boot' on this device please ensure that
+    your boot-loader understands md/v1.x metadata, or use
+    --metadata=0.90
+mdadm: size set to 523264K
 ```
 
+Il faut confirmer avec `y`:
+
+```
+Continue creating array? y
+```
+
+Confirmation:
+
+```
+mdadm: Defaulting to version 1.2 metadata
+mdadm: array /dev/md1 started.
+```
+
+Ensuite on formate cette partition:
+
+```bash
+mkfs.ext4 /dev/md1
+```
+
+## Partitions de données
+
+On utilise RAID1 pour le serveur de redondance
+
+```bash
+mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sd[a-b]3
+```
+
+
+### Chiffrement LUKS de la partition principale
+
+Initialiser le chiffrement LUKS sur le RAID :
+
+```bash
+cryptsetup -q -s 512 -c aes-xts-plain64 luksFormat /dev/md0
+```
+
+```bash
+# cryptsetup -q -s 512 -c aes-xts-plain64 luksFormat /dev/md0
+Enter passphrase for /dev/md0: 
+```
+
+On récupère l'UUID et **on le note précieusement** :
+
+```bash
+cryptsetup luksDump /dev/md0 | grep UUID | awk '{print $2}'
+```
+
+:::information
+
+Cette information (UUID) sera nécessaire au moment de configurer le déchiffrement au démarrage
+
+:::
+
+Ouvrir le conteneur chiffré :
+
+```bash
+cryptsetup luksOpen /dev/md0 raid_crypt
+```
+
+Saisir la passphrase:
+
+```
+Enter passphrase for /dev/md0: 
+```
+
+
+
 
 # Configuration de LVM
 

+ 62 - 0
gnu-linux/serveurs/proxmox/nested-virtualization-with-vmware.md

@@ -0,0 +1,62 @@
+Memo – Deriving QEMU CPU Flags from /proc/cpuinfo
+
+When enabling nested virtualization (e.g., VMware Workstation inside a Proxmox VM), you may need to explicitly pass CPU flags to the guest. Proxmox does not always expose all hardware capabilities by default.
+
+1. Inspect the host CPU capabilities
+
+On the Proxmox host:
+
+```
+cat /proc/cpuinfo
+```
+
+Look at the two sections:
+	•	flags → general CPU instruction set features.
+	•	vmx flags (Intel) or svm flags (AMD) → virtualization-specific capabilities.
+
+Example from the host (Intel):
+
+flags       : ... ssse3 sse4_1 sse4_2 aes xsave avx avx2 fma bmi1 bmi2 ...
+vmx flags   : ... ept vpid unrestricted_guest ...
+
+
+⸻
+
+2. Identify features relevant for nested virtualization
+
+From vmx flags pick the virtualization extensions required by VMware/VirtualBox:
+	•	+vmx → base Intel VT-x.
+	•	+ept, +unrestricted_guest, +vpid → needed for running 64-bit nested guests.
+
+From flags pick common instruction set extensions that modern hypervisors expect:
+	•	SIMD: +ssse3, +sse4.1, +sse4.2
+	•	Crypto: +aes
+	•	Vector ops: +avx, +avx2, +fma
+	•	State save/restore: +xsave, +xsaveopt, +xsavec, +xsaves, +xgetbv1
+	•	Performance: +bmi1, +bmi2, +invtsc, +pdpe1gb, +tsc-deadline
+
+⸻
+
+3. Translate into QEMU arguments
+
+Proxmox’s cpu: directive does not always accept adding +vmx.
+Instead, use the args: directive to override QEMU’s -cpu line:
+
+args: -cpu host,+vmx,+ssse3,+sse4.1,+sse4.2,+aes,+xsave,+xsaveopt,+xsavec,+xgetbv1,+xsaves,+avx,+avx2,+fma,+bmi1,+bmi2,+invtsc,+pdpe1gb,+tsc-deadline
+
+This ensures the guest OS and nested hypervisors see the same set of CPU capabilities that exist on the host.
+
+⸻
+
+4. Verify inside the guest
+
+Inside the Windows or Linux guest, confirm the flags are visible:
+	•	On Linux:
+
+cat /proc/cpuinfo | grep -E "vmx|avx|fma|sse4"
+
+
+	•	On Windows: use Coreinfo.exe (Sysinternals) or CPU-Z to check feature availability.
+
+If vmx (Intel VT-x) or svm (AMD-V) is exposed, nested hypervisors like VMware Workstation can run.
+

+ 18 - 0
todo.md

@@ -0,0 +1,18 @@
+
+- [Nepenthes - Piégez les crawlers web malveillants | Applications web | Le site de Korben](https://korben.info/nepenthes-piege-crawlers-web-malveillants.html)
+- Serveur email haute-disponibilité : [Carbonio - La solution de messagerie qui va (enfin) vous libérer des GAFAM | Open source | Le site de Korben](https://korben.info/carbonio-la-solution-de-messagerie-qui-va-enfin-vous-liberer-des-gafam.html)
+- 
+
+
+
+* [Open Source Pocket Alternatives for iPhone: Top 7 Bookmark Managers | AlternativeTo](https://alternativeto.net/software/pocket/?license=opensource&platform=iphone)
+* [wallabag: Save and classify articles. Read them later. Freely | AlternativeTo](https://alternativeto.net/software/wallabag/about/)
+* [Save the web, freely | wallabag: a self hostable application for saving web pages](https://wallabag.org/#)
+* [Installation – wallabag documentation](https://doc.wallabag.org/admin/installation/installation/)
+
+
+### Martian Sources
+
+* [ ] [security - Martian sources from my public IP - Server Fault](https://serverfault.com/questions/788439/martian-sources-from-my-public-ip)
+* [ ] [martian source from itself | Proxmox Support Forum](https://forum.proxmox.com/threads/martian-source-from-itself.125714/)
+* [ ] [Martian source | Proxmox Support Forum](https://forum.proxmox.com/threads/martian-source.105701/)