#!/bin/sh # Pour la configuration firewall GREEN='\033[0;32m' YELLOW='\033[1;33m' NOCOLOR='\033[0m' echo "${YELLOW} ** ${NOCOLOR} Début du script : 09-Firewall" echo "${NOCOLOR}" echo "${YELLOW} * ${NOCOLOR} Installation composant" echo "${NOCOLOR}" apt install -y ufw >> /dev/null echo "${YELLOW} * ${NOCOLOR} Installation composant : ${GREEN} OK" echo "${NOCOLOR}" echo "${YELLOW} * ${NOCOLOR} Configuration" echo "${NOCOLOR}" ufw default deny incoming ufw default allow outgoing ufw allow 2222/tcp # Votre port SSH ufw enable echo "${YELLOW} * ${NOCOLOR} Configuration : ${GREEN} OK" echo "${NOCOLOR}" echo "${YELLOW} ** ${NOCOLOR} Fin du script : 09-Firewall" echo "${NOCOLOR}"