Kaynağa Gözat

Mise à jour 24/02/2025

lauhub 9 ay önce
ebeveyn
işleme
9207c80248
58 değiştirilmiş dosya ile 2251 ekleme ve 17 silme
  1. 181 0
      gnu-linux/bash/parent-process-output.md
  2. 33 0
      gnu-linux/debian.md
  3. 45 0
      gnu-linux/gpg.md
  4. 5 0
      gnu-linux/monitoring-surveillance.md
  5. 14 0
      gnu-linux/serveurs/installation/00-sommaire-installation.md
  6. 39 0
      gnu-linux/serveurs/installation/TODO.md
  7. 63 4
      gnu-linux/serveurs/installation/ecaz-serveur-proxmox.md
  8. BIN
      gnu-linux/serveurs/installation/images/reverse-dns-ovh-1.png
  9. BIN
      gnu-linux/serveurs/installation/images/reverse-dns-ovh-2.png
  10. BIN
      gnu-linux/serveurs/installation/images/reverse-dns-ovh-3.png
  11. BIN
      gnu-linux/serveurs/installation/images/reverse-dns-ovh-4.png
  12. BIN
      gnu-linux/serveurs/installation/images/reverse-dns-ovh-5.png
  13. 15 0
      gnu-linux/serveurs/installation/lvm-extension.md
  14. 31 13
      gnu-linux/serveurs/installation/post-installation-serveur.md
  15. 231 0
      gnu-linux/serveurs/installation/reverse-proxy.md
  16. 40 0
      gnu-linux/serveurs/installation/ufw.md
  17. 345 0
      gnu-linux/serveurs/installation/yunohost.md
  18. 138 0
      gnu-linux/serveurs/proxmox/configuration-ovh.md
  19. 55 0
      gnu-linux/serveurs/proxmox/configuration-utilisateurs.md
  20. 16 0
      gnu-linux/serveurs/proxmox/gestion-reseau-proxmox.md
  21. 47 0
      gnu-linux/serveurs/proxmox/gestion-vm.md
  22. BIN
      gnu-linux/serveurs/proxmox/images/configuration-1.png
  23. BIN
      gnu-linux/serveurs/proxmox/images/configuration-10.png
  24. BIN
      gnu-linux/serveurs/proxmox/images/configuration-11.png
  25. BIN
      gnu-linux/serveurs/proxmox/images/configuration-12.png
  26. BIN
      gnu-linux/serveurs/proxmox/images/configuration-13.png
  27. BIN
      gnu-linux/serveurs/proxmox/images/configuration-14.png
  28. BIN
      gnu-linux/serveurs/proxmox/images/configuration-16.png
  29. BIN
      gnu-linux/serveurs/proxmox/images/configuration-17.png
  30. BIN
      gnu-linux/serveurs/proxmox/images/configuration-18.png
  31. BIN
      gnu-linux/serveurs/proxmox/images/configuration-19.png
  32. BIN
      gnu-linux/serveurs/proxmox/images/configuration-2.png
  33. BIN
      gnu-linux/serveurs/proxmox/images/configuration-21.png
  34. BIN
      gnu-linux/serveurs/proxmox/images/configuration-22.png
  35. BIN
      gnu-linux/serveurs/proxmox/images/configuration-23.png
  36. BIN
      gnu-linux/serveurs/proxmox/images/configuration-25.png
  37. BIN
      gnu-linux/serveurs/proxmox/images/configuration-26.png
  38. BIN
      gnu-linux/serveurs/proxmox/images/configuration-3.png
  39. BIN
      gnu-linux/serveurs/proxmox/images/configuration-5.png
  40. BIN
      gnu-linux/serveurs/proxmox/images/configuration-6.png
  41. BIN
      gnu-linux/serveurs/proxmox/images/configuration-7.png
  42. BIN
      gnu-linux/serveurs/proxmox/images/configuration-8.png
  43. BIN
      gnu-linux/serveurs/proxmox/images/configuration-9.png
  44. BIN
      gnu-linux/serveurs/proxmox/images/reseau-1.png
  45. 61 0
      gnu-linux/serveurs/proxmox/infrastructure-ovh.md
  46. 207 0
      gnu-linux/serveurs/securisation/ban-connection-port.md
  47. 6 0
      gnu-linux/serveurs/securisation/bastion.md
  48. 235 0
      gnu-linux/serveurs/securisation/firewall.md
  49. 38 0
      gnu-linux/serveurs/securisation/honey-pot.md
  50. 12 0
      gnu-linux/serveurs/securisation/iptables.md
  51. 12 0
      gnu-linux/serveurs/securisation/solution-ipset.md
  52. 54 0
      organisation-technique/services.md
  53. 55 0
      projets/environnement-de-bureau.md
  54. BIN
      reseau-labo-ipi/images/configuration-20.png
  55. 3 0
      reseau-labo-ipi/routeur-cisco.md
  56. 24 0
      ssh/algorithmes-chiffrement.md
  57. 12 0
      ssh/bash-completion-ssh.md
  58. 234 0
      ssh/tunnel-autossh.md

+ 181 - 0
gnu-linux/bash/parent-process-output.md

@@ -0,0 +1,181 @@
+% Parent process output
+
+# Tags
+
+How to find
+comment trouver
+
+parent process pid 
+parent process terminal
+
+# Introduction
+
+Comment trouver la sortie standard (ou d'erreur) d'un processus parent ?
+
+# Codes
+
+## Approche 1: en analysant les PPID
+
+```bash
+parent_process_output(){
+	local output
+	if [[ -z "${1}" ]]
+	then
+		output=/dev/stderr
+	else
+		output=$1
+	fi
+	if [[ -t $output ]]
+	then
+		#echo "STDERR is opened in terminal"
+		:
+	else
+		#echo "STDERR is NOT opened in terminal"
+		if [[ -e $output ]]
+		then
+			#ls -l $output
+			if [[ -L $output ]]
+			then
+				parent_process_output $(readlink $output)
+			else
+				echo $output
+			fi
+		else
+				echo $output
+		fi
+	fi
+}
+parent_process_output
+
+parent_process_terminal(){
+	local ppid
+	if [[ -z "${1}" ]]
+	then
+		ppid=$(ps --pid $$ -o ppid=  | xargs)
+	fi
+	parent_term=$(readlink /proc/${ppid}/fd/2)
+	echo "${ppid}> $parent_term"
+	if [[ -c "${parent_term}" ]]
+	then
+		if [[ "${parent_term}" = "/dev/null" && ! "${parent_term}" =~ ^socket:.* ]]
+		then
+			parent_process_terminal $(ps --pid ${ppid} -o ppid=  | xargs)
+		else
+			echo ${parent_term}
+		fi
+	else
+		if [[ $ppid -gt 1 ]]
+		then
+			parent_process_terminal $(ps --pid ${ppid} -o ppid=  | xargs)
+		else
+			echo /dev/stderr
+		fi
+	fi
+}
+parent_process_terminal
+
+```
+
+## Approche 2 : en analysant l'appelant
+
+Fonctionne avec `systemctl`
+
+```bash
+echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
+ps -elf | grep 'systemctl' | grep -v grep | awk '{print $13}' | sort -u | while read term ; do echo "$term"; lsof /dev/$term ; echo ; echo "TEST:$term" > /dev/$term ; done
+echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
+```
+
+Le code complet:
+
+```sh
+
+has_parent_process(){
+	local parent_to_search
+	local ppid
+	parent_to_search="${1:-}"
+	if [ -z "${parent_to_search:-}" ]
+	then
+		echo "ERROR: need parent process pid as first arg" >&2
+		return 5
+	fi
+	local pid
+	pid="${2:-}"
+	if [ -z "${pid:-}" ]
+	then
+		pid=$$
+	fi
+	if [ $parent_to_search = $pid ]
+	then
+		echo ${parent_to_search}
+		return 0
+	else if [ $pid > 1 ]
+		then
+			ppid=$(ps --pid ${pid} -o ppid= | xargs)
+			if [ $ppid = $pid ]
+			then
+				echo "ERROR: pid=$pid is the same as ppid=$ppid" >&2
+				echo -1
+			else
+				has_parent_process ${parent_to_search} ${ppid}
+			fi
+		else
+			echo "NOT FOUND: ${parent_to_search}" >&2
+			echo 1
+		fi
+	fi
+	return 1
+}
+
+find_pid_user_of(){
+	local used_file=$1
+	local regex="$2"
+	lsof ${used_file} | awk 'NR>1 && $1 ~ /'${regex}'/ && !($2 in a){a[$2]++; print $2}'
+}
+
+find_systemctl_pids(){
+	ps -elf | grep 'systemctl' | grep -v grep | awk '{print $13}' | sort -u | while read term
+	do
+		#echo "$term ---"
+		#lsof /dev/$term
+		#lsof -F 'cp' /dev/$term
+		#echo "$term >>>"
+		#lsof /dev/$term | awk 'NR>1 && $1 ~ /.*sh$/ && !($2 in a){a[$2]++; print $2}'
+		if [ -z "${shell_pid:-}" ]
+		then
+			shell_pid=$(find_pid_user_of /dev/$term '.*sh$')
+		fi
+		if [ -z "${systemctl_pid:-}" ]
+		then
+			systemctl_pid=$(find_pid_user_of /dev/$term 'systemctl')
+		fi
+		#echo "shell_pid=$shell_pid" >&2
+		#echo "systemctl_pid=$systemctl_pid" >&2
+		echo ${shell_pid} ${systemctl_pid}
+		#echo "TEST:$term" > /dev/$term
+	done
+}
+
+#echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
+#declare -g shell_pid=""
+#declare -g systemctl_pid=""
+#ps -elf | grep 'systemctl' | grep -v grep | awk '{print $13}' | sort -u | while read term ; do echo "$term"; lsof /dev/$term ; echo "TEST:$term" > /dev/$term ; done
+process_and_parent=`find_systemctl_pids`
+
+if has_parent_process ${process_and_parent}
+then
+	shell_process=$(echo ${process_and_parent} | awk '{print $1}')
+	parent_term=`readlink /proc/${shell_process}/fd/2`
+fi
+
+#echo "Parent terminal: ${parent_term}"
+#echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
+
+
+printf "#######################\n\r" >&2
+printf "# IMPORTANT WARNING ! #\n\r" >&2
+printf "#######################\n\r" >&2
+```
+
+
+

+ 33 - 0
gnu-linux/debian.md

@@ -0,0 +1,33 @@
+% Debian
+
+# Réparer une Debian mal installée et sans réseau
+
+## Rescue mode
+
+Configurer le réseau manuellement
+
+Quand il propose de rentrer dans un shell, aller sur Go Back et sélectionner `Réinstaller les composants de base`
+
+## Rustdesk
+
+### Installation
+
+
+```bash
+sudo apt install -y wget xvfb libgtk-3-0 libnotify4 libglib2.0-0 libnss3 libxss1 libasound2 libxdo3 curl gstreamer1.0-pipewire
+
+
+```
+
+
+Récupérer l'adresse du .deb ici (voir la dernière version):
+
+https://github.com/rustdesk/rustdesk/releases/tag/1.3.7
+
+```bash
+wget https://github.com/rustdesk/rustdesk/releases/download/1.3.7/rustdesk-1.3.7-x86_64.deb
+```
+
+```bash
+sudo dpkg -i rustdesk-1.3.7-x86_64-ubuntu.deb
+```

+ 45 - 0
gnu-linux/gpg.md

@@ -0,0 +1,45 @@
+% GPG et vérification des clés
+
+```bash
+sudo apt install gpg dirmngr gpg-agent
+```
+
+[VerifyISOImage - Debian Wiki](https://wiki.debian.org/VerifyISOImage)
+
+```bash
+gpg --keyserver keyring.debian.org --recv-keys 64E6EA7D 6294BE9B 09EA8AC3
+```
+
+Ce qui donne:
+
+```
+gpg: key 42468F4009EA8AC3: "Debian Testing CDs Automatic Signing Key <debian-cd@lists.debian.org>" not changed
+gpg: key DA87E80D6294BE9B: "Debian CD signing key <debian-cd@lists.debian.org>" not changed
+gpg: key 988021A964E6EA7D: "Debian CD signing key <debian-cd@lists.debian.org>" not changed
+gpg: Total number processed: 3
+gpg:              unchanged: 3
+
+```
+
+```bash
+wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA256SUMS
+wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA256SUMS.sign
+```
+
+Puis :
+
+```bash
+gpg --with-fingerprint --verify SHA256SUMS.sign SHA256SUMS 
+```
+
+Ce qui doit donner:
+
+```
+gpg: Signature made Sat 11 Jan 2025 07:08:10 PM CET
+gpg:                using RSA key DF9B9C49EAA9298432589D76DA87E80D6294BE9B
+gpg: Good signature from "Debian CD signing key <debian-cd@lists.debian.org>" [unknown]
+gpg: WARNING: This key is not certified with a trusted signature!
+gpg:          There is no indication that the signature belongs to the owner.
+Primary key fingerprint: DF9B 9C49 EAA9 2984 3258  9D76 DA87 E80D 6294 BE9B
+```
+

+ 5 - 0
gnu-linux/monitoring-surveillance.md

@@ -0,0 +1,5 @@
+% Monitoring et surveillance
+
+[Outils de monitoring sur Linux Magazine](../../../08_engagements/articles/InfluxDB, Grafana et Glances, le monitoring qui brille _ Connect - Editions Diamond - linux-magazine.html)
+
+[InfluxDB, Grafana et Glances, le monitoring qui brille | Connect - Editions Diamond](https://connect.ed-diamond.com/GNU-Linux-Magazine/glmf-209/influxdb-grafana-et-glances-le-monitoring-qui-brille)

+ 14 - 0
gnu-linux/serveurs/installation/00-sommaire-installation.md

@@ -0,0 +1,14 @@
+% Sommaire installation
+
+# Étapes
+
+1. [Serveur Proxmox : ecaz.aezi.fr](ecaz-serveur-proxmox.md)
+2. A VÉRIFIER ORDRE AVEC SUIVANT [Installation de proxmox](installation-proxmox.md)
+3. A VÉRIFIER ORDRE AVEC PRÉCÉDENT [Configuration du PVE Proxmox](../proxmox/configuration-ovh.md)
+4. [Post installation du serveur](post-installation-serveur.md)
+5. [Installation du Firewall](../securisation/firewall.md)
+6. 
+
+Puis:
+
+[Infrastructure du réseau sur serveur Kimsufi OVH](../proxmox/infrastructure-ovh.html)

+ 39 - 0
gnu-linux/serveurs/installation/TODO.md

@@ -0,0 +1,39 @@
+- [ ] Sécuriser serveur selon 
+  - Use strong ciphers and algorithms. Although recent versions of OpenSSH support strong algorithms, ensure that CHACHA20 and curve25519 are preferred to ensure the safest cryptographic operation. [https://goteleport.com/blog/security-hardening-ssh-bastion-best-practices/](https://goteleport.com/blog/security-hardening-ssh-bastion-best-practices/)
+    - Voir: [encryption - How to disable weak ciphers in SSH? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/333728/how-to-disable-weak-ciphers-in-ssh)
+- [ ] two factor
+  - Probably the simplest yet most effective control is to implement a second factor authentication in your SSH server. Google’s Google Authenticator PAM module is the popular choice. But it only supports TOTP-based authentication. For more robust authentication, opt for solutions that enable authentication based on [U2F](https://www.yubico.com/authentication-standards/fido-u2f/) or [WebAuthn](https://en.wikipedia.org/wiki/WebAuthn) for SSH.
+  
+
+
+## Fail2ban
+
+https://github.com/fail2ban/fail2ban/issues/3567#issuecomment-2625933592
+
+I applied your workaround to my `jail.local` in the first time and here is what I got:
+
+```
+While reading from '/etc/fail2ban/jail.local' [line 272]: option 'backend' in section 'sshd' already exists
+```
+
+So I had to investigate further and _tried_ to understand what happened, trying not to break my current configuration (`backend = %(sshd_backend)s`). And as I am conservative and tried to keep the "Debian" configuration, the workaround I found was the one mentioned.
+
+And I _tried_ to share this, not to be awarded in any positive or negative manner, but _trying_ to help.
+
+So in one word: the workaround you gave did not sound so good to me, and the fact that fail2ban has to be tweaked before it can start at once on Debian did not help me to be confident in your solution. And the way you answer to people did not help either.
+
+
+---
+
+
+I applied your workaround to my `jail.local` in the first time and it did not work at once.
+
+So I had to investigate further and _tried_ to understand what happened, trying not to break my current configuration (`backend = %(sshd_backend)s`). And as I am conservative and tried to keep the "Debian" configuration, the workaround I found was the one mentioned.
+
+And I _tried_ to share this, not to be awarded in any positive or negative manner, but _trying_ to help.
+
+So in one word: the workaround you gave did not sound so good to me, and the fact that fail2ban has to be tweaked before it can start at once on Debian did not help me to be confident in your solution.
+
+The way you answered to people did not help either.
+
+It is always important to understand that people are not machines which just behave like computers. And why

+ 63 - 4
gnu-linux/serveurs/installation/ecaz-serveur-proxmox.md

@@ -766,15 +766,24 @@ tasksel install standard
 $ sudo ufw allow ssh
 Rules updated
 Rules updated (v6)
-lauhub@ecaz:~$ sudo ufw allow http
+$ sudo ufw allow http
 Rules updated
 Rules updated (v6)
-lauhub@ecaz:~$ sudo ufw allow https
+$ sudo ufw allow https
 Rules updated
 Rules updated (v6)
+$ sudo ufw allow out to any port 53
+$ sudo ufw default allow outgoing
+$ sudo ufw default allow routed
+```
 
 ```
+sudo nano /etc/default/ufw
+```
+
+Mettre: `DEFAULT_FORWARD_POLICY="ACCEPT"`
 
+Source: [Proxmox - Server setup · GitHub](https://gist.github.com/rdroro/9988478)
 
 ## Verrouillage de `cryptroot-unlock` dans `dropbear`
 
@@ -1130,7 +1139,9 @@ DROPBEAR_OPTIONS="-F -E -p 64357 -s -j -k -I 60"
 #DROPBEAR_SHUTDOWN_TIMEOUT=60
 ```
 
-# Weebographie
+# Webographie
+
+## Partitionnement
 
 * [Linux Partitioning Recommendations | Average Linux User](https://averagelinuxuser.com/linux-partitioning-recommendations/)
 * [Utiliser LVM pour la swap](https://j.hommet.net/utiliser-lvm-pour-la-swap/)
@@ -1147,13 +1158,15 @@ DROPBEAR_OPTIONS="-F -E -p 64357 -s -j -k -I 60"
 * [[SOLVED] - Good Practice for Disks Setup | Proxmox Support Forum](https://forum.proxmox.com/threads/good-practice-for-disks-setup.113957/)
 * [luks | Proxmox Support Forum](https://forum.proxmox.com/tags/luks/)
 * [[TUTORIAL] - Adding Full Disk Encryption to Proxmox | Proxmox Support Forum](https://forum.proxmox.com/threads/adding-full-disk-encryption-to-proxmox.137051/)
+
+## Installation
+
 * [Install Proxmox VE on Debian 12 Bookworm - Proxmox VE](https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm)
 * [Installing Proxmox VE](https://pve.proxmox.com/pve-docs/chapter-pve-installation.html#install_recommended_requirements)
 * [Encrypting Proxmox VE (Best Methods) | Proxmox Support Forum](https://forum.proxmox.com/threads/encrypting-proxmox-ve-best-methods.88191/)
 * [[SOLVED] How to remove an MDADM Raid Array, Once and For All!](https://ubuntuforums.org/showthread.php?t=884556)
 * [Using multiple swap partitions in a specific order on Linux | www.bentasker.co.uk](https://www.bentasker.co.uk/posts/documentation/linux/using-multiple-swap-partitions-in-a-specific-order-on-linux.html)
 * [Architecture de services avec Proxmox sur un serveur kimsufi - Vincent Dillenschneider](https://vdillenschneider.fr/architecture-de-services-avec-proxmox-sur-un-serveur-kimsufi)
-* [Cette application vous empêche d'utiliser les réseaux sociaux tant que vous n'êtes pas sorti marcher un peu | korii.](https://korii.slate.fr/tech/application-reseaux-sociaux-blocage-marche-quota-pas-quotidiens-steppin-ios?utm_source=firefox-newtab-fr-fr)
 * [lvcreate with max size available](https://www.linuxquestions.org/questions/linux-hardware-18/lvcreate-with-max-size-available-749253/)
 * [Manually installing Debian 12 (Bookworm) with fully encrypted LUKS (besides /boot) using debootstrap | Steffen’s random thoughts](https://blog.scheib.me/2023/08/28/debootstrapping-debian-bookworm.html)
 * [linux - How to wait for mdadm RAID array's resync process to fully complete? - Stack Overflow](https://stackoverflow.com/questions/77328149/how-to-wait-for-mdadm-raid-arrays-resync-process-to-fully-complete)
@@ -1202,4 +1215,50 @@ DROPBEAR_OPTIONS="-F -E -p 64357 -s -j -k -I 60"
 * [16.04 - I can't use the shutdown command because the system "Failes to Connect to bus: No such file or directory" - Ask Ubuntu](https://askubuntu.com/questions/999042/i-cant-use-the-shutdown-command-because-the-system-failes-to-connect-to-bus-n)
 * [macos - Keyboard preferences are lost after each restart - Ask Different](https://apple.stackexchange.com/questions/343842/keyboard-preferences-are-lost-after-each-restart/343843?noredirect=1#comment717541_343843)
 * [finalize debootstrap debian - Lilo](https://search.lilo.org/?q=finalize+debootstrap+debian&plugin=lilose)
+* [Proxmox Storage Configuration for Beginners - Virtualization Howto](https://www.virtualizationhowto.com/2025/01/proxmox-storage-configuration-for-beginners/)
+* [Proxmox 8: New Features and Home Lab Upgrade Instructions - Virtualization Howto](https://www.virtualizationhowto.com/2023/06/proxmox-8-new-features-and-home-lab-upgrade-instructions/)
+* [Proxmox - Page 3 of 6 - Virtualization Howto](https://www.virtualizationhowto.com/category/proxmox/page/3/)
+* [Proxmox Network Configuration for Beginners including VLANs - Virtualization Howto](https://www.virtualizationhowto.com/2025/01/proxmox-network-configuration-for-beginners-including-vlans/)
+* [Proxmox 8: New Features and Home Lab Upgrade Instructions - Virtualization Howto](https://www.virtualizationhowto.com/2023/06/proxmox-8-new-features-and-home-lab-upgrade-instructions/)
+* [Install Proxmox in VMware Workstation Pro - Virtualization Howto](https://www.virtualizationhowto.com/2024/05/install-proxmox-in-vmware-workstation-pro/)
+* [Proxmox Subscription and Update Repositories Beginners Guide - Virtualization Howto](https://www.virtualizationhowto.com/2024/05/proxmox-subscription-and-update-repositories-beginners-guide/)
+* [Creating a Resource Pool & VM in Proxmox - Part 4 - BDRSuite](https://www.bdrsuite.com/blog/creating-a-resource-pool-vm-in-proxmox-part-4/)
+* [Proxmox Homelab: First 5 Basic Configuration Steps - Virtualization Howto](https://www.virtualizationhowto.com/2023/10/proxmox-homelab-first-5-basic-configuration-steps/)
+
+
+Stockage
+
+* [Storage - Proxmox VE](https://pve.proxmox.com/wiki/Storage)
+* [Storage: Directory - Proxmox VE](https://pve.proxmox.com/wiki/Storage:_Directory)
+* [Disks and partitions best practices questions | Proxmox Support Forum](https://forum.proxmox.com/threads/disks-and-partitions-best-practices-questions.145879/)
+* [(1) [SOLVED] - Good Practice for Disks Setup | Proxmox Support Forum](https://forum.proxmox.com/threads/good-practice-for-disks-setup.113957/)
+
+
+Réseau
 
+* [Proxmox: Configure a network bridge for internal networking – WirelessThings](https://wirelessthings.io/index.php/2023/11/02/proxmox-configure-a-network-bridge-for-internal-networking/)
+* [Proxmox: Set up NAT for VMs - techlr.de](https://techlr-de.translate.goog/proxmox-nat-vms-einrichten/?_x_tr_sl=de&_x_tr_tl=en&_x_tr_hl=de&_x_tr_pto=wapp)
+* [Configurer un serveur proxmox avec une seule ip publique - Ludovic Meurot](https://meurot.me/articles/proxmox-avec-une-seule-ip-publique/2)
+* [Utiliser Proxmox avec une adresse ip publique | Wiki - The Abyss Project](https://wiki.abyssproject.net/fr/proxmox/proxmox-with-one-public-ip)
+* [(1) [SOLVED] - How to configure the network correct | Proxmox Support Forum](https://forum.proxmox.com/threads/how-to-configure-the-network-correct.24335/)
+* [Network Configuration - Proxmox VE](https://pve.proxmox.com/wiki/Network_Configuration)
+* [(1) [SOLVED] - Proxmox single IP Setup | Proxmox Support Forum](https://forum.proxmox.com/threads/proxmox-single-ip-setup.141153/)
+* [(1) [SOLVED] - Proper vlan setting in proxmox. | Proxmox Support Forum](https://forum.proxmox.com/threads/proper-vlan-setting-in-proxmox.121645/)
+* [(1) NAT masquerading on VLAN interfaces doesn't work | Proxmox Support Forum](https://forum.proxmox.com/threads/nat-masquerading-on-vlan-interfaces-doesnt-work.143001/)
+
+
+## Réseau et container
+
+* [Proxmox Permissions for Users, Groups, and Pools : r/Proxmox](https://www.reddit.com/r/Proxmox/comments/txajsi/proxmox_permissions_for_users_groups_and_pools/)
+* [Proxmox - UCC Wiki](https://wiki.ucc.asn.au/Proxmox)
+* [reseau:cloud:proxmox:pool [Les cours du BTS SIO]](https://siocours.lycees.nouvelle-aquitaine.pro/doku.php/reseau/cloud/proxmox/pool)
+* [Boost Your ProxmoxVE Efficiency: Unlock the Power of Resource Pools and Tags | by Deepen Dhulla | Medium](https://deependhulla.medium.com/boost-your-proxmoxve-efficiency-unlock-the-power-of-resource-pools-and-tags-1e292a352ea6)
+* [Linux Container - Proxmox VE](https://pve.proxmox.com/wiki/Linux_Container)
+
+## Bootloader Grub
+
+* [debian - How do I make grub install on a software-raid disk? - Server Fault](https://serverfault.com/questions/1019079/how-do-i-make-grub-install-on-a-software-raid-disk)
+* [grub2 - Required GRUB modules for booting on mdadm RAID1 - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/196212/required-grub-modules-for-booting-on-mdadm-raid1)
+* [grub2 - Simple mdadm RAID 1 setup for booting degraded and reverting upgrades? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/564665/simple-mdadm-raid-1-setup-for-booting-degraded-and-reverting-upgrades)
+* [linux - How to correctly install GRUB on a soft RAID 1? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/230349/how-to-correctly-install-grub-on-a-soft-raid-1)
+* [partitioning - grub2-install: "this GPT partition label contains no BIOS Boot Partition" - Super User](https://superuser.com/questions/903112/grub2-install-this-gpt-partition-label-contains-no-bios-boot-partition)

BIN
gnu-linux/serveurs/installation/images/reverse-dns-ovh-1.png


BIN
gnu-linux/serveurs/installation/images/reverse-dns-ovh-2.png


BIN
gnu-linux/serveurs/installation/images/reverse-dns-ovh-3.png


BIN
gnu-linux/serveurs/installation/images/reverse-dns-ovh-4.png


BIN
gnu-linux/serveurs/installation/images/reverse-dns-ovh-5.png


+ 15 - 0
gnu-linux/serveurs/installation/lvm-extension.md

@@ -0,0 +1,15 @@
+% Extension de volumes LVM
+
+Ajout de disque virtuel dans une machine
+
+`/dev/sdb`
+
+
+```
+# pvcreate /dev/sdb
+  Physical volume "/dev/sdb" successfully created.
+# vgextend debian-template-vg /dev/sdb
+  Volume group "debian-template-vg" successfully extended
+```
+
+

+ 31 - 13
gnu-linux/serveurs/installation/post-installation-serveur.md

@@ -32,31 +32,34 @@ sudo dpkg-reconfigure tzdata
 
 # Sécurisation
 
+## Installation des mises à jour de sécurité automatiques
+
+```bash
+sudo apt-get install unattended-upgrades
+```
+
+
 ## SSH
 
 `/etc/ssh/sshd_config`
 
 ```
+Port 22 # sera désactivé plus tard
+Port 64305
+
 PermitRootLogin prohibit-password
 PasswordAuthentication no
 PermitEmptyPasswords no
 ```
 
-## Firewall
 
-Installation et configuration
-
-```bash
-sudo apt install ufw
-sudo ufw allow ssh
-sudo ufw allow http
-sudo ufw allow https
-sudo ufw enable
-```
+## fail2ban
 
+:::information
 
+REVÉRIFIER CETTE PARTIE LÀ
 
-## fail2ban
+:::
 
 Installation de `fail2ban`
 
@@ -71,9 +74,24 @@ sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
 sudo nano /etc/fail2ban/jail.local
 ```
 
-
-
 ```bash
 sudo systemctl restart fail2ban
+sudo systemctl status fail2ban
+```
+
+Modification de /etc/jail.local : remplacer la valeur de `backend` par `systemd`
+
+```
+backend = systemd
 ```
 
+## Blocage du port 22 et bannissement automatique
+
+[Bannissement de toute connection à un port donné](../securisation/ban-connection-port.html)
+
+
+
+## Bastion
+
+[What is an SSH Bastion? | SSH Bastion host setup](https://goteleport.com/blog/ssh-bastion-host/)
+

+ 231 - 0
gnu-linux/serveurs/installation/reverse-proxy.md

@@ -0,0 +1,231 @@
+% Reverse Proxy
+
+# Introduction
+
+Voir [Infrastructure du réseau sur serveur Kimsufi OVH](../proxmox/infrastructure-ovh.html)
+
+# Installation letsencrypt
+
+cf [Certbot Instructions | Certbot](https://certbot.eff.org/instructions?ws=nginx&os=pip)
+
+## Dépendances
+
+```bash
+sudo apt update && sudo apt install python3 python3-venv libaugeas0
+```
+
+## Installation de `certbot`
+
+```bash
+sudo python3 -m venv /opt/certbot/
+sudo /opt/certbot/bin/pip install --upgrade pip
+sudo /opt/certbot/bin/pip install certbot certbot-nginx
+sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
+```
+
+# Installation des sous-domaines
+
+## Domaines à installer
+
+On prépare une liste des services et de leur sous-domaine associé. Par exemple, voir cette page: [Services](../../../organisation-technique/services.html)
+
+## Configuration de `nginx`
+
+### Chargement dans les sous-dossiers
+
+Édition de `/etc/nginx/nginx.conf`
+
+Remplacer la ligne:
+
+```conf
+include /etc/nginx/sites-enabled/*;
+```
+
+Par:
+
+```conf
+include /etc/nginx/sites-enabled/*/*;
+```
+
+
+
+## Script
+
+Je crée un script d'installation qui génère automatiquement chaque fichier de configuration `nginx` pour les sous-domaines listés dans un fichier (ici par exemple: `subdomains.txt`) :
+
+```bash
+$ cat ~/subdomains.txt 
+nu.aezi.fr        
+cloud.aezi.fr     
+git.aezi.fr       
+wallabag.aezi.fr  
+appflowy.aezi.fr  
+rustdesk.aezi.fr  
+sync.aezi.fr      
+pihole.aezi.fr    
+hedgedoc.aezi.fr  
+dessin.aezi.fr
+```
+
+### Script  `install-subdomains`
+
+**IMPORTANT**: script inspiré de ce gist: [How to use nginx as a reverse-proxy with letsencrypt · GitHub](https://gist.github.com/gmolveau/5e5b0bd2773100d85d9302d0fa96632d)
+
+**ATTENTION**: si le script ne fonctionne pas, voir la variante en dessous.
+
+
+```bash
+#!/bin/bash
+
+set -euo pipefail
+
+if [ $EUID != 0 ]
+then
+	echo "You must be root" >&2
+	exit 1
+fi
+
+
+available_sites_dir=/etc/nginx/sites-available
+
+subdomains_list="${1:-}"
+if [ -z "${subdomains_list:-}" ]
+then
+	echo "Please give me a subdomain list"
+	exit 2
+fi
+shift
+
+
+create_subdomain(){
+	local base_directory=$2
+	local subdomain_name=$1
+	local target_ip=$3
+	local main_domain=$4
+	if [ ! -f "$base_directory/$subdomain_name" ]
+	then
+		echo "Creating '$base_directory/$subdomain_name'"
+		cat > $base_directory/$subdomain_name <<EOF
+server {
+    server_name $subdomain_name;
+
+    listen 80;
+    listen [::]:80;
+
+    location / {
+        proxy_pass  https://$target_ip:443;
+        proxy_redirect                      off;
+        proxy_set_header  Host              \$http_host;
+        proxy_set_header  X-Real-IP         \$remote_addr;
+        proxy_set_header  X-Forwarded-For   \$proxy_add_x_forwarded_for;
+        proxy_set_header  X-Forwarded-Proto \$scheme;
+        proxy_read_timeout                  900;
+    }
+}
+EOF
+	fi
+}
+
+while read subdomain
+do
+	subdomain=$(echo $subdomain | xargs)
+
+	if [ -n "$subdomain" ]
+	then
+		echo "subdomain='$subdomain'"
+		domain_name=${subdomain#*.}
+		domain_dir=${available_sites_dir}/${domain_name}
+		if [ ! -d ${domain_dir} ]
+		then
+			echo "Creating dir '${domain_dir}'"
+			mkdir -p ${domain_dir}
+		fi
+		create_subdomain $subdomain ${domain_dir} 10.1.0.14 nu.aezi.fr
+	fi
+done < ${subdomains_list}
+```
+
+
+#### Variante
+
+Ajouter le code suivant dans la section `server` sous la section `listen 80;    listen [::]:80;` :
+
+```bash
+    # HTTP to HTTPS
+    if ($scheme != "https") {
+        return 301 https://$host$request_uri;
+    } # managed by Certbot
+```
+
+## Activation des fichiers de configuration
+
+Après avoir généré les fichiers avec le le script précédent (et fait les modifications indiquées dans `nginx.conf` au paragraphe précédent), on active les configurations des sites:
+
+```bash
+cd /etc/nginx/sites-enabled/aezi.fr
+ls ../../sites-available/aezi.fr/ | xargs -i{} sudo ln -s ../../sites-available/aezi.fr/{}
+```
+
+## Installation du certificat
+
+L'installation du certificat se fait en lançant :
+
+```bash
+sudo certbot --nginx
+```
+
+Puis en sélectionnant la liste des certificats en sélectionnant le premier comme principal (ici : `nu.aezi.fr`).
+
+(en cas de mauvaise manipulation voir [Dépannage](#depannage))
+
+Donc on saisit `5` pour mettre nu.aezi.fr en premier puis les autres numéros:
+
+```
+5 1 2 3 4 6 7 8 9
+```
+
+Ce qui donne:
+
+```bash
+$ sudo certbot --nginx
+Saving debug log to /var/log/letsencrypt/letsencrypt.log
+
+Which names would you like to activate HTTPS for?
+We recommend selecting either all domains, or all domains in a VirtualHost/server block.
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+1: appflowy.aezi.fr
+2: dessin.aezi.fr
+3: git.aezi.fr
+4: hedgedoc.aezi.fr
+5: nu.aezi.fr
+6: pihole.aezi.fr
+7: rustdesk.aezi.fr
+8: sync.aezi.fr
+9: wallabag.aezi.fr
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Select the appropriate numbers separated by commas and/or spaces, or leave input
+blank to select all options shown (Enter 'c' to cancel): 
+```
+
+Une fois que c'est près, normalement tout devrait fonctionner
+
+
+# Dépannage{#depannage}
+
+## Modifier le domaine principal
+
+Il faut le mettre en premier et utiliser `--force-renewal`:
+
+```bash
+./certbot --apache -d domaine-principal.fr -d www.domaine-principal.fr -d mysql.domaine-principal.fr --force-renewal
+```
+
+Voir: [cette réponse à "Change base domain name for Lets Encrypt SSL certificate"](https://stackoverflow.com/a/38268048/1011366)
+
+## Notes supplémentaires
+
+* [reverse proxy - Nginx http to http redirect 400 The plain HTTP request was sent to HTTPS port - Server Fault](https://serverfault.com/questions/1115189/nginx-http-to-http-redirect-400-the-plain-http-request-was-sent-to-https-port)
+* [NGINX Error: The plain HTTP request was sent to HTTPS port - Sling Academy](https://www.slingacademy.com/article/nginx-error-the-plain-http-request-was-sent-to-https-port/)
+* [Dealing with nginx 400 "The plain HTTP request was sent to HTTPS port" error - Stack Overflow](https://stackoverflow.com/questions/8768946/dealing-with-nginx-400-the-plain-http-request-was-sent-to-https-port-error)
+* [ssl - Update certificate with certbot to add subdomain - Stack Overflow](https://stackoverflow.com/questions/55778765/update-certificate-with-certbot-to-add-subdomain)
+

+ 40 - 0
gnu-linux/serveurs/installation/ufw.md

@@ -0,0 +1,40 @@
+% UFW
+
+
+## Firewall
+
+Installation et configuration
+
+```bash
+sudo apt install ufw
+sudo ufw allow ssh
+sudo ufw allow http
+sudo ufw allow https
+sudo ufw allow 64035/tcp # Après avoir ajouté Port 64035 dans sshd_config
+sudo ufw enable
+```
+
+```bash
+$ sudo ufw allow ssh
+Rules updated
+Rules updated (v6)
+lauhub@ecaz:~$ sudo ufw allow http
+Rules updated
+Rules updated (v6)
+lauhub@ecaz:~$ sudo ufw allow https
+Rules updated
+Rules updated (v6)
+$ sudo ufw allow out to any port 53
+$ sudo ufw default allow outgoing
+$ sudo ufw default allow routed
+
+```
+
+```
+sudo nano /etc/default/ufw
+```
+
+Mettre: `DEFAULT_FORWARD_POLICY="ACCEPT"`
+
+Source: [Proxmox - Server setup · GitHub](https://gist.github.com/rdroro/9988478)
+

Dosya farkı çok büyük olduğundan ihmal edildi
+ 345 - 0
gnu-linux/serveurs/installation/yunohost.md


+ 138 - 0
gnu-linux/serveurs/proxmox/configuration-ovh.md

@@ -0,0 +1,138 @@
+% Configuration du PVE Proxmox
+
+# Données
+
+## Téléchargement d'image ISO
+
+Aller dans Datacenter > <NOM_DU_LOCAL> > local
+
+![](images/configuration-1.png)
+
+Cliquer sur `ISO Images`:
+
+![](images/configuration-2.png)
+
+
+Cliquer sur `Download from URL`. Une boîte de dialogue apparaît.
+
+Sur la [page des téléchargment Debian](https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/), copier l'URL du premier fichier ISO. Par exemple: `debian-12.9.0-amd64-netinst.iso`
+
+Coller cette valeur dans le premier champ de la boîte de dialogue:
+
+![](images/configuration-3.png)
+
+Cliquer sur Query URL pour compléter automatiquement le nom du fichier.
+
+Revenir sur la page de téléchargement de Debian et vérifier les sommes de contrôle SHA-256 ([voir cette page](https://www.debian.org/CD/verify)) et [ce guide](../../gpg.html).
+
+Copier la somme de contrôle correspondant à l'image sélectionnée.
+
+Dans la boîte de dialogue, sélectionner *SHA-256* dans le champ *Hash algorithm* et coller la valeur copiée dans le champ *Checksum*
+
+![](images/configuration-5.png)
+
+Cliquer sur `Download` et vérifier que le téléchargement se termine
+
+Le nouveau fichier apparaîtra dans la liste des images disponibles:
+
+![](images/configuration-6.png)
+
+# Réseau
+
+Pour mon réseau je vais créer:
+
+1. un réseau pour mes services cloud
+   1. Yunohost
+      1. NextCloud
+      2. etc
+   2. Webdav
+2. un réseau pour mes hébergements Web
+3. un réseau pour mes services "données" (pas d'interface Web)
+
+## Configuration d'un bridge en masquerading
+
+Création du bridge
+
+- Nom: `vmbr0`
+- IPv4/CIDR: `10.1.0.0/24`
+- VLAN Aware: non
+- Autostart: oui
+
+![](images/configuration-7.png)
+
+Le fichier /etc/network/interfaces résultat comporte ceci:
+
+```
+auto eth0
+iface eth0 inet static
+	address 188.165.235.71/24
+	gateway 188.165.235.254
+	alias eno1 enp0s25
+	network 188.165.235.0
+	dns-nameservers 213.186.33.99 208.67.222.123
+# IP publique
+
+
+#Réseau Interne
+auto vmbr0
+iface vmbr0 inet static
+	address 10.1.0.0/16
+	bridge-ports none
+	bridge-stp off
+	bridge-fd 0
+#Réseau Interne
+```
+
+:::warning
+
+**VOIR REMARQUE CI-DESSOUS**
+
+On **n'active pas** les lignes suivantes dans la section `vmbr0`
+
+```
+    post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
+    post-up   iptables -t nat -A POSTROUTING -s '10.1.0.0/24' -o eth0 -j MASQUERADE
+    post-down iptables -t nat -D POSTROUTING -s '10.1.0.0/24' -o eth0 -j MASQUERADE
+```
+
+```
+#post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
+#post-up   iptables -t nat -A POSTROUTING -s '10.1.0.0/24' -o eth0 -j MASQUERADE
+#post-up   iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
+#post-down iptables -t nat -D POSTROUTING -s '10.1.0.0/24' -o eth0 -j MASQUERADE
+#post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
+```
+
+
+Car on les ajoute dans le FIREWALL, parce que c'est merdique sinon (gestion des règles pas terribles, plus disparition du ip_forward de temps en temps)
+
+
+:::
+
+
+### IP Forwarding {#ipforwarding}
+
+Éditer le fichier `/etc/sysctl.conf` et y décommenter les lignes suivantes:
+
+```conf
+net.ipv4.ip_forward=1
+# ...
+net.ipv6.conf.all.forwarding=1
+```
+
+Mettre à jour le système par rapport à cette nouvelle configuration :
+
+```bash
+sudo sysctl -p
+```
+
+
+Voir: 
+
+1. [Network Configuration - Proxmox VE](https://pve.proxmox.com/wiki/Network_Configuration)
+2. [Proxmox: NAT für VMs einrichten › techlr.de](https://techlr-de.translate.goog/proxmox-nat-vms-einrichten/?_x_tr_sl=de&_x_tr_tl=en&_x_tr_hl=de&_x_tr_pto=wapp)
+3. [Proxmox -  Netfilter POSTROUTING SNAT rules not hit | blog.lobraun.de](https://web.archive.org/web/20220610151210/https://blog.lobraun.de/2019/05/19/prox/)
+
+## Désactiver le firewall
+
+Datacenter > Firewall > Options > Firewall : No

+ 55 - 0
gnu-linux/serveurs/proxmox/configuration-utilisateurs.md

@@ -0,0 +1,55 @@
+% Configuration des utilisateurs
+
+Voir: [User Management - Proxmox VE](https://pve.proxmox.com/wiki/User_Management)
+
+
+```
+$ sudo pveum group add admin -comment "System Administrators"
+$ sudo  pveum acl modify / -group admin -role Administrator
+$ sudo  pveum user modify testuser@pve -group admin^C
+$ sudo pveum user add laurent@pve -comment "Laurent HUBERT"
+$ sudo pveum passwd laurent@pve
+Enter new password: ***********************************
+Retype new password: ***********************************
+$ pveum passwd laurent@pve^C
+$ sudo  pveum user modify laurent@pve -group admin
+$ 
+```
+
+
+Proxmox IPI B1
+
+```
+$ cat  apply-config-reseau 
+#!/bin/bash
+
+
+#adresse_original=192.168.100.2
+INTERFACES_FILE=/etc/network/interfaces
+ORIGINAL_GATEWAY=$(awk '$1 == "gateway" { print $2 }' ${INTERFACES_FILE})
+
+GATEWAY=10.29.10.253
+NEW_ADDRESS=10.29.10.200
+DNS_SERVER=1.1.1.1
+
+if ! grep '^#configlaurent$' /etc/network/interfaces > /dev/null 2>&1
+then
+	# C'est pas ma config
+	echo Je backup
+	cp ${INTERFACES_FILE} ${INTERFACES_FILE}.original
+	cp /etc/hosts /etc/hosts.original
+	cp /etc/hostname /etc/hostname.original
+	echo '#configlaurent' >> ${INTERFACES_FILE}
+fi
+
+ORIGINAL_ADDRESS=$(awk '$1 == "address" { split( $2, a, "/") ; print a[1] }' ${INTERFACES_FILE}.original)
+
+if [[ "${ORIGINAL_GATEWAY}" != "${GATEWAY}" ]]
+then
+	sed -i.switch3560  -E	-e 's,(address )[^/]+,\1'$NEW_ADDRESS',g' \
+		-e 's,(gateway ).+$,\1'$GATEWAY',g' \
+		-e '/gateway .+$/a        dns-nameservers '$DNS_SERVER'' /etc/network/interfaces
+	sed -E -e 's,^'$ORIGINAL_ADDRESS','$NEW_ADDRESS',g' /etc/hosts.original > /etc/hosts
+fi
+
+```

+ 16 - 0
gnu-linux/serveurs/proxmox/gestion-reseau-proxmox.md

@@ -0,0 +1,16 @@
+% Gestion des réseaux sous proxmox
+
+
+# Création d'un réseau privé
+
+Un bridge devient privé s'il n'est relié à aucun port bridgé. Dans ce cas il devient un simple switch sans aucun routage (il faut créer un routeur pour ça)
+
+![Réseau privé](images/reseau-1.png)
+
+Ici `192.168.12.0/24` est l'identifiant du réseau pour lequel le "switch" fonctionnera.
+
+# Réseau `NAT`é
+
+Mettre un routeur entre le réseau privé et un réseau externe
+
+

+ 47 - 0
gnu-linux/serveurs/proxmox/gestion-vm.md

@@ -0,0 +1,47 @@
+% Gestion des VM
+
+# Pool de ressources
+
+On va créer un pool de ressource
+
+Ceci permet d'allouer à un groupe de VM des permissions (cf [reseau:cloud:proxmox:pool [Les cours du BTS SIO]](https://siocours.lycees.nouvelle-aquitaine.pro/doku.php/reseau/cloud/proxmox/pool))
+
+
+
+# Création de VM
+
+![](images/configuration-8.png)
+
+![](images/configuration-9.png)
+
+![](images/configuration-10.png)
+
+![](images/configuration-11.png)
+
+![](images/configuration-12.png)
+
+![](images/configuration-13.png)
+
+## Réseau
+
+### Firewall
+Désactiver l'option `Firewall`:
+
+![](images/configuration-17.png)
+
+![](images/configuration-18.png)
+
+### Résolution de problèmes
+
+Il faut parfois rebooter l'hôte.
+
+
+Voir [Comment installer un cluster Proxmox pour sa domotique - YouTube](https://www.youtube.com/watch?v=XmTCFlEA_EE&t=719s)
+
+
+Des références à explorer:
+
+[Vous avez cherché proxmox - Assetware Technology](https://www.assetware-technology.com/?s=proxmox)
+
+
+

BIN
gnu-linux/serveurs/proxmox/images/configuration-1.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-10.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-11.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-12.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-13.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-14.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-16.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-17.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-18.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-19.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-2.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-21.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-22.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-23.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-25.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-26.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-3.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-5.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-6.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-7.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-8.png


BIN
gnu-linux/serveurs/proxmox/images/configuration-9.png


BIN
gnu-linux/serveurs/proxmox/images/reseau-1.png


+ 61 - 0
gnu-linux/serveurs/proxmox/infrastructure-ovh.md

@@ -0,0 +1,61 @@
+% Infrastructure du réseau sur serveur Kimsufi OVH
+
+# Plan
+
+1. installer un reverse-proxy nginx
+
+Aide: [Architecture de services avec Proxmox sur un serveur kimsufi - Vincent Dillenschneider](https://vdillenschneider.fr/architecture-de-services-avec-proxmox-sur-un-serveur-kimsufi)
+
+# Reverse Proxy NGINX
+
+## Certificats
+
+```
+                           client
+                             |
+                           nginx
+                     (https://example1.com) <-- certificats
+                     (https://example1.com) <-- certificats
+                     (https://example1.com) <-- certificats
+                              |
+        +---------------------+------------------------------+
+        |                     |                              |
+        |                     |                              |
+https://srv1.reseau.priv   https://example2.reseau.priv   https://example3.reseau.priv
+       a.b.c.d                  e.f.g.h                    i.j.k.l
+```
+
+
+[Which ssl certificates go where on an reverse proxy? - nginx - Server Fault](https://serverfault.com/questions/975690/which-ssl-certificates-go-where-on-an-reverse-proxy-nginx)
+
+## Installation antiX
+
+Configurer le réseau en 10.1.0.aaa/16
+
+
+![](images/configuration-19.png)
+
+
+
+# À étudier
+
+Utiliser les noms pour forwarder TCP sur certains hôtes (pour les connexions SSH ? ou alors bastion ?)
+
+[Nginx TCP forwarding based on hostname - Stack Overflow](https://stackoverflow.com/questions/34741571/nginx-tcp-forwarding-based-on-hostname/40135151#40135151)
+
+
+# VM reverse-proxy
+
+
+```
+sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 10.1.0.10:80
+sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to 10.1.0.10:443
+
+sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 10.1.0.10:80
+sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to 10.1.0.10:443
+
+sudo iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.1.0.10:80
+sudo iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 443 -j DNAT --to 10.1.0.10:443
+```
+
+  

+ 207 - 0
gnu-linux/serveurs/securisation/ban-connection-port.md

@@ -0,0 +1,207 @@
+% Bannissement de toute connection à un port donné
+
+# Introduction
+
+L'objectif est que toute IP qui se connecte à un port donné (par exemple le port 22) se retrouve bannie via `iptables` avec `ipset`.
+
+# Installation
+
+## `ipset`
+
+```bash
+sudo apt update
+sudo apt install ipset
+```
+
+## Création d'un set d'IP bannies
+
+```bash
+sudo ipset create banned_ips hash:ip
+```
+
+## Création d'une règle IP tables pour bloquer les IP du set
+
+```
+sudo iptables -I INPUT -m set --match-set banned_ips src -j DROP
+```
+
+## Règle pour le bannissement à la première connexion
+
+```bash
+sudo iptables -I INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -m recent --set --name SSH_BLOCK --rsource
+sudo iptables -I INPUT -p tcp --dport 22 -m recent --update --hitcount 1 --name SSH_BLOCK --rsource -j SET --add-set banned_ips src
+```
+
+
+
+### Persistence `iptables`
+
+
+
+# Persistence `ipset`
+
+## Non automatisée
+
+### À l'extinction de la machine
+
+```bash
+sudo ipset save banned_ips > /etc/ipset_banned_ips.save
+```
+
+### Au démarrage
+
+```bash
+sudo ipset restore < /etc/ipset_banned_ips.save
+```
+
+
+## Script automatisé
+
+
+On met ce script dans `/usr/local/bin/ipset-ban-persist` :
+
+```bash
+#!/bin/bash
+
+# Nom du set
+SET_NAME="banned_ips"
+SAVE_FILE="/etc/ipset_banned_ips.save"
+
+# Fonction pour créer le set s'il n'existe pas
+init_set() {
+    if ! ipset list "$SET_NAME" >/dev/null 2>&1; then
+        if [ -f "$SAVE_FILE" ]; then
+            ipset restore < "$SAVE_FILE"
+        else
+            ipset create "$SET_NAME" hash:ip
+        fi
+    fi
+    iptables -I INPUT -m set --match-set "$SET_NAME" src -j DROP
+}
+
+# Fonction pour ajouter une IP au set
+ban_ip() {
+    local IP="$1"
+    ipset add "$SET_NAME" "$IP"
+}
+
+# Fonction pour enregistrer le set
+save_set() {
+    ipset save "$SET_NAME" > "$SAVE_FILE"
+}
+
+
+# Exécution
+case "$1" in
+    start)
+        init_set
+        ;;
+    stop)
+        save_set
+        ;;
+    ban)
+        if [ -n "$2" ]; then
+            ban_ip "$2"
+        else
+            echo "Usage: $0 ban <IP>"
+        fi
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|ban <IP>}"
+        ;;
+esac
+```
+
+
+
+On le rend exécutable:
+
+```bash
+sudo chmod +x /usr/local/bin/ipset-ban-persist
+```
+
+## Démarrage automatique avec systemd
+
+On crée le fichier `/etc/systemd/system/ipset-ban-persist.service` avec ce contenu :
+
+```
+[Unit]
+Description=IPSet Ban Management
+After=network.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/ipset-ban-persist start
+ExecStop=/usr/local/bin/ipset-ban-persist stop
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
+```
+
+```bash
+sudo systemctl enable ipset-ban-persist
+```
+
+## Vérification
+
+Il semble nécessaire de le démarrer et arrêter pour créer effectivement le fichier:
+
+```
+sudo systemctl start ipset-ban-persist ; sudo systemctl stop ipset-ban-persist
+```
+
+Vérifier que le fichier `/etc/ipset_banned_ips.save` soit présent.
+
+
+
+# Gestion des bannissements
+
+## Lister les IP bannies
+
+```bash
+sudo ipset list banned_ips
+```
+
+## Supprimer une IP bannie
+
+```bash
+ipset del banned_ips 1.2.3.4
+```
+
+
+## Ajouter une IP manuellement
+
+```bash
+sudo ipset add banned_ips 1.2.3.4
+```
+
+
+# Persistence du firewall
+
+## `ufw` (non recommandé)
+
+Mettre la règle suivante avant la règle `*filter`
+
+```conf
+#Bans ipset banned_ips
+-A INPUT -m set --match-set banned_ips src -j DROP
+#Bans ipset banned_ips (END)
+```
+
+Ce qui donne:
+
+```conf
+# Don't delete these required lines, otherwise there will be errors
+*filter
+#Bans ipset banned_ips
+-A INPUT -m set --match-set banned_ips src -j DROP
+#Bans ipset banned_ips (END)
+:ufw-before-input - [0:0]
+:ufw-before-output - [0:0]
+:ufw-before-forward - [0:0]
+:ufw-not-local - [0:0]
+# End required lines
+```
+
+

+ 6 - 0
gnu-linux/serveurs/securisation/bastion.md

@@ -0,0 +1,6 @@
+% Bastion
+
+* [(1) Option for double bastion Terraform setup? | Proxmox Support Forum](https://forum.proxmox.com/threads/option-for-double-bastion-terraform-setup.94418/)
+* [(1) Best practices for having a SSH jumphost | Proxmox Support Forum](https://forum.proxmox.com/threads/best-practices-for-having-a-ssh-jumphost.112357/)
+* [What is an SSH Bastion? | SSH Bastion host setup](https://goteleport.com/blog/ssh-bastion-host/)
+* [ssh - SSHFS over a jumphost - Server Fault](https://serverfault.com/questions/941934/sshfs-over-a-jumphost)

+ 235 - 0
gnu-linux/serveurs/securisation/firewall.md

@@ -0,0 +1,235 @@
+% Installation du Firewall
+
+# Utilisation de lfirewall
+
+## Récupération
+
+```bash
+git clone git@git.hubbros.fr:lhubert/lfirewall.git
+cd lfirewall
+```
+
+## Installation
+
+```bash
+sudo make
+```
+
+## COnfiguration
+
+```bash
+sudo cp /etc/lfirewall/lfirewall.conf /etc/lfirewall/lfirewall.conf.local
+```
+
+On édite le fichier `/etc/lfirewall/lfirewall.conf.local` :
+
+Et on place les lignes suivante:
+
+```
+ALLOW_IP_FORWARDING=0
+
+NETWORK_IF=eth0
+
+
+#SSH
+SSH_PORT="64035"
+
+TCP_SERVICES="22"
+
+# Web server
+TCP_SERVICES="http https $TCP_SERVICES"
+
+#...
+
+REMOTE_TCP_SERVICES="80 443" # Web browsing
+REMOTE_TCP_SERVICES="22 $REMOTE_TCP_SERVICES" # SSH
+REMOTE_TCP_SERVICES="20 $REMOTE_TCP_SERVICES" # FTP
+
+REMOTE_TCP_SERVICES="$REMOTE_TCP_SERVICES $SAMBA_PORTS"
+
+REMOTE_UDP_SERVICES="53" # DNS
+
+BANNED_LISTS="et_spamhaus spamhaus_drop et_dshield"
+```
+
+## Création des listes ipset
+
+```bash
+sudo ipset create whitelist hash:net hashsize 4096
+sudo ipset add whitelist 83.193.14.206
+sudo ipset create et_spamhaus hash:net hashsize 4096
+sudo ipset create spamhaus_drop hash:net hashsize 4096
+sudo ipset create et_dshield hash:net hashsize 4096
+```
+
+## Installation de firehol-tools (update-ipsets)
+
+:::warning
+
+Faire: `sudo update-ipsets enable et_spamhaus spamhaus_drop et_dshield` ne fonctionne pas bien
+
+:::
+
+```bash
+for chain in et_spamhaus spamhaus_drop et_dshield
+do
+    sudo update-ipsets enable $chain
+    sudo update-ipsets -s run $chain
+done
+```
+
+## Rendre les ipset persistentes
+
+```bash
+sudo apt install ipset-persistent
+```
+
+Supprimer ufw si nécessaire
+
+
+### Mise à jour régulière
+
+```bash
+sudo crontab -e
+```
+
+Et ajouter
+
+```
+# Mise à jour des listes de ban
+0 */2 * * * /usr/sbin/update-ipsets -s > /dev/null 2>&1
+```
+
+## Installation des règles de bannissement automatique pour le port 22
+
+[Bannissement de toute connection à un port donné](ban-connection-port.html)
+
+### Enregistrement de ces règles dans lfirewall
+
+```bash
+sudo  iptables-save -t filter -f /etc/lfirewall/iptables-user.v4
+sudo  ip6tables-save -t filter -f /etc/lfirewall/iptables-user.v6
+```
+
+Ajout des règles pour le reverse-proxy:
+
+```
+# Generated by iptables-save v1.8.9 on Fri Feb 14 01:09:27 2025
+*raw
+:PREROUTING ACCEPT [468:33624]
+:OUTPUT ACCEPT [465:35352]
+-A PREROUTING -i fwbr+ -j CT --zone 1
+-A PREROUTING -i fwbr+ -j CT --zone 1
+COMMIT
+# Completed on Fri Feb 14 01:09:27 2025
+# Generated by iptables-save v1.8.9 on Fri Feb 14 01:09:27 2025
+*nat
+:PREROUTING ACCEPT [24:968]
+:INPUT ACCEPT [23:908]
+:OUTPUT ACCEPT [0:0]
+:POSTROUTING ACCEPT [0:0]
+-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.0.10:80
+-A PREROUTING -i eth0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.1.0.10:443
+-A POSTROUTING -s 10.1.0.0/24 -o eth0 -j MASQUERADE
+-A POSTROUTING -s 10.1.0.0/24 -o eth0 -j MASQUERADE
+COMMIT
+# Completed on Fri Feb 14 01:09:27 2025
+
+```
+
+## Test du firewall
+
+### Premier test
+
+BIEN SUIVRE TOUTES LES INSTRUCTIONS
+
+Sur la machine à tester:
+
+```bash
+sudo lfirewall test &
+```
+
+DANS LES 30s: depuis un autre terminal, ouvrir une autre session SSH (la connexion doit être immédiate)
+
+### Second test
+
+Ajouter la ligne suivante dans le crontab de root:
+
+```bash
+*/10 * * * * /usr/sbin/lfirewall clear
+```
+
+Tester le firewall en réel:
+
+```bash
+sudo lfirewall start
+```
+
+### Afficher les règles iptables:
+
+```bash
+sudo iptables -L -v
+```
+
+```
+Chain INPUT (policy DROP 9 packets, 380 bytes)
+ pkts bytes target     prot opt in     out     source               destination         
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh match-set whitelist src
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:https match-set whitelist src
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:http match-set whitelist src
+    1    60 DROP       all  --  any    any     anywhere             anywhere             match-set et_dshield src
+    0     0 DROP       all  --  any    any     anywhere             anywhere             match-set spamhaus_drop src
+    0     0 DROP       all  --  any    any     anywhere             anywhere             match-set et_spamhaus src
+    0     0 DROP       tcp  --  eth0   any     anywhere             anywhere             tcp dpt:https state NEW recent: UPDATE seconds: 30 hit_count: 20 name: DEFAULT side: source mask: 255.255.255.255
+    0     0            tcp  --  eth0   any     anywhere             anywhere             tcp dpt:https state NEW recent: SET name: DEFAULT side: source mask: 255.255.255.255
+    0     0 DROP       tcp  --  eth0   any     anywhere             anywhere             tcp dpt:http state NEW recent: UPDATE seconds: 30 hit_count: 20 name: DEFAULT side: source mask: 255.255.255.255
+    0     0            tcp  --  eth0   any     anywhere             anywhere             tcp dpt:http state NEW recent: SET name: DEFAULT side: source mask: 255.255.255.255
+    0     0 SET        tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh recent: UPDATE hit_count: 1 name: SSH_BLOCK side: source mask: 255.255.255.255 add-set banned_ips src
+    0     0            tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh ctstate NEW recent: SET name: SSH_BLOCK side: source mask: 255.255.255.255
+    1    40 DROP       all  --  any    any     anywhere             anywhere             match-set banned_ips src
+  698 56728 ACCEPT     all  --  any    any     anywhere             anywhere             state RELATED,ESTABLISHED
+   12   384 ACCEPT     icmp --  any    any     anywhere             anywhere            
+    0     0 ACCEPT     all  --  lo     any     anywhere             anywhere            
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:http
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:https
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh
+    1    64 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:64035
+    0     0 ACCEPT     all  --  lo     any     localhost            localhost           
+    0     0 ACCEPT     all  --  lo     any     localhost            localhost           
+    0     0 ACCEPT     all  --  lo     any     localhost            localhost           
+    0     0 ACCEPT     all  --  lo     any     localhost            localhost           
+    9   380 LOG        all  --  any    any     anywhere             anywhere             LOG level warn
+
+Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
+ pkts bytes target     prot opt in     out     source               destination         
+    0     0 LOG        all  --  any    any     anywhere             anywhere             LOG level warn
+
+Chain OUTPUT (policy DROP 0 packets, 0 bytes)
+ pkts bytes target     prot opt in     out     source               destination         
+    6   688 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:64035
+  350 21995 ACCEPT     all  --  any    lo      localhost            localhost           
+    0     0 ACCEPT     all  --  any    lo      localhost            localhost           
+    0     0 ACCEPT     all  --  any    lo      localhost            localhost           
+    0     0 ACCEPT     all  --  any    lo      localhost            localhost           
+    0     0 ACCEPT     all  --  any    lo      anywhere             anywhere            
+  316 34444 ACCEPT     all  --  any    any     anywhere             anywhere             state RELATED,ESTABLISHED
+    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere            
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ftp-data
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ftp
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:http
+    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:https
+    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:domain
+    0     0 LOG        all  --  any    any     anywhere             anywhere             LOG level warn
+    0     0 REJECT     all  --  any    any     anywhere             anywhere             reject-with icmp-port-unreachable
+```
+
+## ACtivation du service lfirewall
+
+```bash
+sudo systemctl enable lfirewall
+sudo systemctl start lfirewall
+```
+
+Supprimer les règles crontab après avoir testé que tout fonctionne.
+

+ 38 - 0
gnu-linux/serveurs/securisation/honey-pot.md

@@ -0,0 +1,38 @@
+% Pot de miel
+
+[Laurent Biagiotti on LinkedIn: #cybersec #honeypots #tpot #redteam #blueteam #threatintel | 101 comments](https://www.linkedin.com/posts/laurent-biagiotti-19779284_cybersec-honeypots-tpot-ugcPost-7295469594587070464-osG-/?utm_source=share&utm_medium=member_ios&rcm=ACoAAAxiXPABYvesiugBsFCBGvR_HuxIrHPJrEU)
+
+
+
+🐝🍯 T-POT : L’Arme Fatale De La Cyberdéfense (Les Hackers le Détestent) !
+⭕ SPOILER : LE HONEYPOT LE PLUS PUISSANT DU MARCHÉ.
+
+
+Hier, je vous ai parlé de Qeeqbox Honeypots… 
+Un bon outil, rapide à déployer pour comprendre le concept d'HONEYPOT, 
+mais il fait pâle figure face à T-Pot.
+
+⭕ Pourquoi T-Pot est le niveau supérieur ?
+
+𝗣𝗟𝗨𝗦 de honeypots ➯ +40 faux services contre 20 chez Qeeqbox.
+𝗣𝗟𝗨𝗦 de visibilité ➯ Dashboards interactifs, attaques cartographiées en temps réel.
+𝗣𝗟𝗨𝗦 d’intégration ➯ Elastic Stack, Suricata, Spiderfoot, Cyberchef…
+𝗣𝗟𝗨𝗦 de persistance ➯ Stockage et analyse avancée des logs & malwares capturés.
+𝗣𝗟𝗨𝗦 de modularité ➯ Déployable en standalone, distribué, cloud, VM ou même Raspberry Pi.
+
+⭕ Voici l’arsenal qui les attend :
+
+Réseaux & accès ➯ Cowrie (SSH/Telnet), ADBHoney (Android Debug Bridge), Beelzebub (ChatGPT-powered deception), Endlessh (SSH tarpit)
+Messagerie & protocoles ➯ Mailoney (SMTP), Medpot (DICOM), Heralding (credentials capture), SentryPeer (SIP)
+Web & bases de données ➯ Elasticpot (Elasticsearch), Log4Pot (Log4j exploit), Redishoneypot (Redis), Wordpot (WordPress)
+Failles connues critiques ➯ Conpot (SCADA/ICS), CitrixHoneypot (Citrix exploits), Dionaea (Malware capture), CiscoASA (Cisco exploits), Honeyaml (custom honeypots)
+
+⭕ DÉPLOYEZ-LE EN UNE SEULE COMMANDE :
+
+env bash -c "$(curl -sL https://raw.githubusercontent.com/telekom-security/tpotce/master/install.sh)"
+
+⭕ HIER, LES HACKERS AVAIENT UNE CHANCE. AUJOURD’HUI, VOUS ÊTES LEUR PIRE CAUCHEMAR. 😈
+
+Lien GITHUB: [GitHub - telekom-security/tpotce: 🍯 T-Pot - The All In One Multi Honeypot Platform 🐝](https://github.com/telekom-security/tpotce)
+
+

+ 12 - 0
gnu-linux/serveurs/securisation/iptables.md

@@ -0,0 +1,12 @@
+% Règles IPTABLES
+
+
+
+## Bannissement lors de la connexion à un port
+
+On va bannir définitvement les tentatives de connexion sur le port 22
+
+```
+sudo iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set --name SSH --rsource -j ACCEPT
+sudo iptables -A INPUT -m recent --update --seconds 600 --hitcount 1 --rttl --name SSH --rsource -j DROP
+```

+ 12 - 0
gnu-linux/serveurs/securisation/solution-ipset.md

@@ -0,0 +1,12 @@
+% FireHOL
+
+À mettre en place
+
+[FireHOL - La protection IP ultime pour votre pare-feu | Cybersécurité | Le site de Korben](https://korben.info/firehol-protection-ip-pare-feu.html)
+
+
+[Nepenthes - Piégez les crawlers web malveillants | Applications web | Le site de Korben](https://korben.info/nepenthes-piege-crawlers-web-malveillants.html)
+
+[Endlessh - Le bourbier des script kiddies | Cybersécurité | Le site de Korben](https://korben.info/endlessh-script-kiddies-trap.html)
+
+[GitHub - itskenny0/fail2ban-endlessh: Combining the powers of endlessh and fail2ban.](https://github.com/itskenny0/fail2ban-endlessh)

+ 54 - 0
organisation-technique/services.md

@@ -0,0 +1,54 @@
+% Services
+
+## Yuno Host
+
+### Domaines et applications
+
+| Sous-domaine        | Application          |
+|---------------------|----------------------|
+| nu.aezi.fr          | le domaine principal |
+| cloud.aezi.fr       | NextCloud, OnlyOffice|
+| git.aezi.fr         | gitea                |
+| wallabag.aezi.fr    | Wallabag             |
+| appflowy.aezi.fr    | AppFlowy             |
+| rustdesk.aezi.fr    | RustDesk Server      |
+| sync.aezi.fr        | SyncThing            |
+| pihole.aezi.fr      | Pi-Hole              |
+| hedgedoc.aezi.fr    | HedgeDoc             |
+| dessin.aezi.fr      | Excalidraw           |
+
+
+### Autres applications
+
+- ntfy (Notification Push vers téléphone)
+- Transmission
+- LibreQR
+- Wekan
+
+
+### À voir ???
+
+- Jitsi Meet
+- PairDrop
+
+## Hors YunoHost
+
+### Sur Alpine containers
+
+|                     |                      |
+|---------------------|----------------------|  
+| `sign.aezi.fr`      | DocuSeal             |
+
+
+---aoff
+
+#### Idée abandonnée
+
+Nom de domaine:
+
+`ao.aezi.fr`
+
+*ao* signifie *nuage* en hawaïen.
+
+
+

+ 55 - 0
projets/environnement-de-bureau.md

@@ -0,0 +1,55 @@
+% Environnement de bureau
+
+# Spécification de l'Environnement de Bureau en Rust
+
+## Objectifs
+- Développer un environnement de bureau performant et robuste en **Rust**.
+- Prioriser la **vitesse d'exécution**, la **robustesse** et l'**ergonomie**.
+- Permettre une **interopérabilité** avec toutes les bibliothèques graphiques existantes sous GNU/Linux.
+- Assurer une **gestion adaptative des tailles de fenêtres** en fonction de la résolution du moniteur (similaire à macOS).
+- Fonctionner principalement sous **Wayland**, avec une compatibilité optionnelle pour **X11**.
+
+## Architecture
+
+### 1. Gestion de l'affichage
+- Utilisation de **Wayland** via `smithay` pour la composition.
+- Support possible de **X11** via `x11-rs` ou `xcb` pour la compatibilité avec d'anciennes applications.
+- Intégration avec **wlroots** pour une gestion avancée des sorties et entrées.
+
+### 2. Interface Graphique et Rendu
+- **Moteurs graphiques supportés**:
+  - `wgpu` (Rust-native, performant, compatible Vulkan/OpenGL/Metal)
+  - `gtk-rs` pour compatibilité GTK
+  - `qt-rs` via `cxx` pour Qt
+  - `druid` ou `skia-rs` pour un rendu custom
+- **Gestion du redimensionnement automatique des fenêtres**:
+  - Récupération des informations de moniteur via `wl_output`
+  - Ajustement dynamique des fenêtres en fonction du DPI et de la résolution
+  - Positionnement intelligent pour optimiser l'espace disponible
+  
+### 3. Gestionnaire de Fenêtres
+- Basé sur **smithay** et inspiré des gestionnaires comme Mutter (Gnome) et Xfwm (XFCE).
+- Prise en charge des **animations fluides** pour le redimensionnement.
+- Compatibilité avec XWayland pour les applications non natives Wayland.
+- Intégration d'un **tiling dynamique optionnel**.
+
+### 4. Gestion des Entrées et Sessions
+- Utilisation de **libinput** pour la gestion du clavier et de la souris.
+- Gestion des sessions via **elogind** ou **systemd-logind**.
+- Support des événements tactiles.
+
+### 5. Composants Clés
+- **Explorateur de fichiers**: intégration avec `gio` ou `rfd`.
+- **Barre des tâches et menu d’applications** inspirés de Rofi/KRunner.
+- **Gestion des notifications** via D-Bus et Freedesktop.
+- **Panneau de configuration** pour l’ergonomie et l’adaptabilité.
+
+## Optimisation et Interopérabilité
+- **Gestion efficace des threads** via `tokio` ou `async-std`.
+- Communication entre composants via **D-Bus** (`zbus`).
+- Système de configuration modulaire avec **fichiers TOML/YAML**.
+
+## Contraintes Ergonomiques (À définir)
+- …
+
+

BIN
reseau-labo-ipi/images/configuration-20.png


+ 3 - 0
reseau-labo-ipi/routeur-cisco.md

@@ -0,0 +1,3 @@
+
+
+![Configuration routage](images/configuration-20.png)

+ 24 - 0
ssh/algorithmes-chiffrement.md

@@ -0,0 +1,24 @@
+% Gestion des algorithmes de chiffrement
+
+
+### Erreurs de compatibilité d'algorithmes d'échange
+
+- "Unable to negotiate with 1.2.3.4 port 22: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1"
+- "Unable to negotiate" "no matching host key type found. Their offer: ssh-rsa"
+
+
+```
+
+Host switch-hp
+    Hostname 10.29.10.10
+    Ciphers 3des-cbc
+    KexAlgorithms +diffie-hellman-group14-sha1
+    HostKeyAlgorithms=+ssh-rsa
+    User user
+```
+ 
+- [SSH returns: no matching host key type found. Their offer: ssh-dss - Ask Ubuntu](https://askubuntu.com/questions/836048/ssh-returns-no-matching-host-key-type-found-their-offer-ssh-dss)
+- [ssh unable to negotiate - no matching key exchange method found - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/402746/ssh-unable-to-negotiate-no-matching-key-exchange-method-found)
+- [LINUX - SSH - no matching key exchange method found - Admin Malin](https://www.adminmalin.fr/linux-ssh-no-matching-key-exchange-method-found/)
+- [Troubleshooting SSH &#8220;No Matching Key Exchange/Host Key Method/Type Found&#8221; errors | Incredigeek](https://www.incredigeek.com/home/troubleshooting-ssh-no-matching-key-exchange-host-key-method-type-found-errors/)
+

+ 12 - 0
ssh/bash-completion-ssh.md

@@ -0,0 +1,12 @@
+% Bash Completion pour SSH
+
+
+
+
+* [How to enable bash completion in macOS](https://www.simplified.guide/macos/bash-completion)
+* [Install Bash Completion for Mac OS-X - MagePsycho Blog](https://blog.magepsycho.com/bash-completion-mac-os-x/)
+* [bash-completion/bash_completion at f565bf9f2c3315a102174eb8b6c93253fc3e9353 · scop/bash-completion](https://github.com/scop/bash-completion/blob/f565bf9f2c3315a102174eb8b6c93253fc3e9353/bash_completion#L2515)
+* [scop/bash-completion: Programmable completion functions for bash](https://github.com/scop/bash-completion)
+* [SSH completion with Include directive and subdirectory · Issue #305 · scop/bash-completion](https://github.com/scop/bash-completion/issues/305)
+* [bash - How to create script with auto-complete? - Ask Ubuntu](https://askubuntu.com/questions/68175/how-to-create-script-with-auto-complete)
+* [Bash and SSH completion with Include directive - HOAB](https://hoab.fr/bash-and-ssh-completion-with-include-directive)

+ 234 - 0
ssh/tunnel-autossh.md

@@ -0,0 +1,234 @@
+% Tunnel SSH avec reverse
+
+# Introduction
+
+L'idée est d'ouvrir un tunnel SSH qui passe par un serveur relai.
+
+Le poste de travail (poste) se connecte à la cible via le relai.
+
+```
+        ____________           ____________
+poste -------------->[ relai ]-------------> cible
+ p_tun >> Tunnel(L) >> p_relai << Tunnel(R) <<port_ssh
+        ____________           _____________
+```
+
+## Définition d'un tunnel `local to server`  :
+
+```
+port client SSH >> Tunnel(L) >> port serveur SSH
+```
+
+## Définition d'un tunnel `reverse from server`  :
+
+```
+port client SSH << Tunnel(R) << port serveur SSH
+```
+
+## Exemple
+
+```
+        __________           _________
+poste ------------>[ relai ]-----------> cible
+  6122>> Tunnel(L) >>6022<< Tunnel(R) <<22
+        __________           _________
+```
+
+- 6122 port d'entrée (1 = in)
+- 6022 port de sortie du tunnel poste > relai (0 = out)
+- 22 port SSH de la cible
+
+# Mise en application
+
+## IPI
+
+- `<poste>`: mon poste de travail (port 6122 sera relié au port 22 de la cible)
+- `<relai>`: `luke`
+  - (port `6022` reliera la sortie du tunnel entrant (poste > relai) à l'entrée du tunnel reverse (relai > cible))
+- `<cible>`: `proxmox-patrick`
+
+Exemple serveur IPI: adresse publique: `185.64.149.17`
+
+## Création d'une paire de clé sur la cible
+
+En tant qu'utilisateur standard (nom = `u_ssh_cible`)
+
+Générer une paire de clé privé/publique sur la `<cible>` **SANS** *passphrase*.
+
+Copier la clé publique (elle sera copiée dans le fichier `authorized_keys` de l'utilisateur `tunnel@<relai>`)
+
+## Mise en place du relai
+
+### Création d'un utilisateur `tunnel` sur `<relai>`
+
+#### Fichier `authorized_keys` pour l'utilisateur `tunnel`
+
+Préfixe:
+
+```
+from="185.64.149.17",no-agent-forwarding,no-pty,no-X11-forwarding,permitopen="localhost:6022",command="/home/tunnel/bin/tunnelcheck"
+```
+
+Copie de la clé publique de la `<cible>`:
+
+```
+from="185.64.149.17",no-agent-forwarding,no-pty,no-X11-forwarding,permitopen="localhost:6022",command="/home/tunnel/bin/tunnelcheck" ssh-ed25519 AAAACccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc u_ssh_cible@cible
+```
+
+#### Création du script de vérification du tunnel
+
+```bash
+mkdir bin
+touch bin/tunnelcheck
+chmod +x bin/tunnelcheck
+```
+
+Copier le code suivant dans `bin/tunnelcheck` :
+
+```bash
+#!/bin/bash
+set -Eeuo pipefail
+
+parameters=(${SSH_ORIGINAL_COMMAND-})
+
+if [[ ${#parameters[@]} -gt 1 ]]
+then
+	server_response=$(ssh -o PasswordAuthentication=no -p ${parameters[1]} -n -f localhost exit 2>&1 | cut -c1-17 || echo "")
+	if [[ ${server_response:-} = "Permission denied" ]]
+	then
+		echo TUNNEL_OK
+		exit 0
+	else
+		echo TUNNEL_KO
+		exit 1
+	fi
+fi
+```
+
+## Mise en place du reverse tunnel sur `<cible>`
+
+### Lancement initial
+
+```bash
+ssh -f -T -N -R 6022:localhost:22 tunnel@relai.aezi.fr
+```
+
+#### Vérification depuis le `<relai>`
+
+Depuis le `<relai>` en tant qu'utilisateur `tunnel`, lancer:
+
+```bash
+SSH_ORIGINAL_COMMAND="tunnel_check 6022" /home/tunnel/bin/tunnelcheck
+```
+
+Vérifier les *fingerprint* si nécessaire
+
+### Mise en place du `crontab`
+
+Sur la machine `<cible>` (en tant qu'`u_ssh_cible` ):
+
+```bash
+crontab -e
+```
+
+Coller la ligne suivante:
+
+```
+*/30 * * * * /usr/bin/ssh tunnel@relai.aezi.fr /home/tunnel/bin/tunnelcheck 6022 && echo OK || /usr/bin/ssh -f -T -N -R 6022:localhost:22 tunnel@relai.aezi.fr
+```
+
+## Depuis le `<poste>` de travail
+
+Ouverture du tunnel vers le `<relai>`
+
+```
+ssh -f -T -N -L 6122:localhost:6022 tunnel@relai.aezi.fr
+```
+
+### Connection
+
+```bash
+ssh -p 6122 u_ssh_cible@localhost
+```
+
+### 
+
+
+```bash
+# Sur ma machine
+ssh -f -T -N -L 6122:localhost:6022 tunnel@relai.aezi.fr
+ssh -L 55522:localhost:55555 tunnel@relai.aezi.fr
+
+# Pour se connecter
+ssh -p 55522 laurent@127.0.0.1
+
+```
+
+## IMPORTANT: à la première connection
+
+Vérifier les *fingerprint*
+
+
+
+# Finalisation de la sécurisation
+
+Désactiver l'utilisateur `tunnel`
+
+### Sur le serveur cible
+
+```bash
+#!/bin/bash
+
+#autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -T -N -R 22:localhost:55555 tunnel@relai.aezi.fr
+#autossh -v -M 0 -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -T -N -f -R 55555:localhost:22 tunnel@relai.aezi.fr
+autossh -v -M 55556 -T -N -f -R 55555:localhost:22 tunnel@relai.aezi.fr
+#ssh -v -f -N -T -R 55555:localhost:22 tunnel@relai.aezi.fr
+
+```
+
+
+# Solution Maison
+
+Côté serveur
+
+```
+ssh tunnel@relai.aezi.fr /home/tunnel/bin/tunnelcheck 55555 && echo OK || ssh -f -T -N -R 55555:localhost:22 tunnel@relai.aezi.fr
+```
+
+Côté relai
+
+```bash
+$ cat bin/tunnelcheck
+#!/bin/bash
+set -Eeuo pipefail
+
+parameters=(${SSH_ORIGINAL_COMMAND-})
+
+if [[ ${#parameters[@]} -gt 1 ]]
+then
+	server_response=$(ssh -o PasswordAuthentication=no -p ${parameters[1]} -n -f localhost exit 2>&1 | cut -c1-17 || echo "")
+	if [[ ${server_response:-} = "Permission denied" ]]
+	then
+		echo TUNNEL_OK
+		exit 0
+	else
+		echo TUNNEL_KO
+		exit 1
+	fi
+fi
+```
+
+Pour tester côté relai:
+
+```bash
+$ SSH_ORIGINAL_COMMAND="tunnel_check 55555" bin/tunnelcheck
+```
+
+
+# Sources
+
+Gestion des sessions et du contrôle
+
+- [shell script - Getting a pid for an ssh process that backgrounded itself - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/389014/getting-a-pid-for-an-ssh-process-that-backgrounded-itself)
+- [linux - How to tell if an ssh ControlMaster connection is in use - Server Fault](https://serverfault.com/questions/211213/how-to-tell-if-an-ssh-controlmaster-connection-is-in-use)
+