adaptation pour mot de passe + suppression

This commit is contained in:
neox 2024-07-10 15:24:58 +02:00
parent 1763f18c38
commit 00cf2cf52d
No known key found for this signature in database
GPG Key ID: 57BC26A3687116F6
4 changed files with 80 additions and 5 deletions

View File

@ -63,6 +63,7 @@ SUBSYSTEM==\"usb_device\", GROUP=\"spice\", MODE=\"0660\"
(user-account (user-account
(name "jerome") (name "jerome")
(comment "Jérôme") (comment "Jérôme")
(password (crypt "password" "$6$abc"))
(group "users") (group "users")
(home-directory "/home/jerome") (home-directory "/home/jerome")
;; ajout de groupes pour virt-manager ;; ajout de groupes pour virt-manager
@ -173,7 +174,6 @@ SUBSYSTEM==\"usb_device\", GROUP=\"spice\", MODE=\"0660\"
"nextcloud-client" "nextcloud-client"
"nitrocli" "nitrocli"
"nmap" "nmap"
"nss-certs"
"ntfs-3g" "ntfs-3g"
"openssh" "openssh"
"openssl" "openssl"

View File

@ -39,7 +39,7 @@ DISK="$1"
# Vérification de l'existence du disque # Vérification de l'existence du disque
if [ ! -b "$DISK" ]; then if [ ! -b "$DISK" ]; then
echo -e "${RED}Creating disk layout...${NC}" echo -e "${RED}There is no such disk as $DISK !${NC}"
exit 1 exit 1
fi fi
@ -90,7 +90,8 @@ echo -e "${GREEN}OK${NC}"
echo -e -n "${BLUE}Moving configuration to its final location...${NC}" echo -e -n "${BLUE}Moving configuration to its final location...${NC}"
mkdir /mnt/etc mkdir /mnt/etc
mv config.scm /mnt/etc/config.scm cp config.scm /mnt/etc/config.scm
sed -i '66d' /mnt/etc/config.scm
echo -e "${GREEN}OK${NC}" echo -e "${GREEN}OK${NC}"
@ -98,6 +99,6 @@ echo -e -n "${BLUE}Installing GNU Guix...${NC}"
herd start cow-store /mnt herd start cow-store /mnt
guix system init /mnt/etc/config.scm /mnt guix system init config.scm /mnt && reboot
echo -e "${GREEN}OK${NC}" echo -e "${RED}Installation has failed${NC}"

View File

@ -89,3 +89,16 @@ sudo wget https://www.fdn.fr/ca-vpn-fdn.crt /etc/openvpn/fdn.crt
### Enjoy ? ### Enjoy ?
Pour gérer le VPN, c'est avec la commande `sudo herd <action> openvpn` Pour gérer le VPN, c'est avec la commande `sudo herd <action> openvpn`
### Supprimer/nettoyer l'installation
17. Récupérer le programme de suppression pré-préparé :
```
wget forge.chalec.org/neox/guix_jerome/raw/branch/master/wipe.sh
```
18. Exécuter l'outil :
```
chmod +x wipe.sh
./wipe.sh
```

61
wipe.sh Normal file
View File

@ -0,0 +1,61 @@
#!/run/current-system/profile/bin/bash
#
# Guix Simplified Installer
#
# Copyright (C) 2024 Adrien Bourmault <neox@a-lec.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set +x
set -e
# Définition des couleurs
RED='\033[0;31m'
GREEN='\033[0;32m'
LIGHT_RED='\033[1;31m'
LIGHT_GREEN='\033[1;32m'
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
NC='\033[0m' # No Color
echo -e "${LIGHT_RED}Welcome to the simple eraser${NC}"
echo -e "${NC}Copyright (C) 2024 Adrien Bourmault <neox@a-lec.org>${NC}"
echo -e "${NC}This program is free software, released under the GNU AGPL version 3 or later.${NC}"
# Chemin vers le disque
DISK="$1"
# Vérification de l'existence du disque
if [ ! -b "$DISK" ]; then
echo -e "${RED}There is no such disk as $DISK !${NC}"
exit 1
fi
echo -e "${BLUE}Wiping LUKS partitions...${NC}"
# Lister les partitions du disque
PARTITIONS=$(lsblk -nlp -o NAME | grep "^$DISK")
# Effacer les en-têtes LUKS de chaque partition
for PARTITION in $PARTITIONS; do
echo -e "${BLUE}Wiping $PARTITION LUKS header...${NC}"
cryptsetup luksErase $PARTITION
done
echo -e -n "${BLUE}Wiping disk layout...${NC}"
parted -s "$DISK" mklabel gpt
echo -e "${GREEN}OK${NC}"