Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5419cb4ddf | ||
|
869f484acd | ||
|
5eb44579e1 | ||
e85193b920 | |||
b831dfe26e | |||
|
8ef43e8740 | ||
cd2e6b7c35 | |||
7451653a18 | |||
8ba5d192d8 | |||
|
46bf69ee87 | ||
|
afc22ebbf9 | ||
|
0d9f1dc79e | ||
|
dda8c9b878 | ||
18dfda0a20 | |||
f2299ee7c1 | |||
d59aa1571c | |||
d38ba48387 | |||
|
0f6de50a66 | ||
|
21252118e7 | ||
|
b6fba20a5b | ||
|
3009bf1f9b |
1
gitclone.sh
Normal file
1
gitclone.sh
Normal file
@ -0,0 +1 @@
|
||||
git clone https://gitea.lyc-lecastel.fr/jarod.pauchet/JPsiotp
|
6
python3
Normal file
6
python3
Normal file
@ -0,0 +1,6 @@
|
||||
python3 -m http.server
|
||||
|
||||
|
||||
--> puis aller sur un navigateur mettre l'adresse ip du host python3 -m http.server + port 8000
|
||||
|
||||
exemple : 192.168.0.55:8000/
|
3
sio2/sisr/20-python/comptes.txt
Normal file
3
sio2/sisr/20-python/comptes.txt
Normal file
@ -0,0 +1,3 @@
|
||||
t1:test1
|
||||
t2:test2
|
||||
t3:test3
|
31
sio2/sisr/20-python/delusers.py
Normal file
31
sio2/sisr/20-python/delusers.py
Normal file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def delete_user(login, full_name):
|
||||
try:
|
||||
os.system(f'sudo userdel -r {login}')
|
||||
print(f"Utilisateur {login} supprimer avec succès.")
|
||||
except Exception as e:
|
||||
print(f"Erreur lors de la suppression de l'utilisateur {login}: {e}")
|
||||
|
||||
def main(filename):
|
||||
try:
|
||||
with open(filename, 'r') as file:
|
||||
for line in file:
|
||||
line = line.strip()
|
||||
if line:
|
||||
login, full_name = line.split(':')
|
||||
delete_user(login.strip(), full_name.strip())
|
||||
except FileNotFoundError:
|
||||
print(f"Le fichier {filename} n'a pas été trouvé.")
|
||||
except Exception as e:
|
||||
print(f"Erreur lors de la lecture du fichier {filename}: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python deluser.py <nom_du_fichier>")
|
||||
else:
|
||||
main(sys.argv[1])
|
10
sio2/sisr/20-python/exo1.py
Normal file
10
sio2/sisr/20-python/exo1.py
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Demander le rayon du cercle à l'utilisateur
|
||||
rayon = float(input("Entrez le rayon du cercle : "))
|
||||
|
||||
# Calculer le périmètre
|
||||
perimetre = 2 * 3.141592 * rayon
|
||||
|
||||
# Afficher le périmètre
|
||||
print("Le périmètre vaut :", perimetre)
|
34
sio2/sisr/20-python/exo2-1.py.old
Normal file
34
sio2/sisr/20-python/exo2-1.py.old
Normal file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Initialiser un tableau vide
|
||||
tableau = []
|
||||
|
||||
# Saisir 5 chiffres
|
||||
for i in range(5):
|
||||
chiffre = float(input(f"Entrez le chiffre {i+1} : "))
|
||||
tableau.append(chiffre)
|
||||
|
||||
# Trouver plus petit élément
|
||||
plus_petit = tableau[0]
|
||||
for chiffre in tableau:
|
||||
if chiffre < plus_petit:
|
||||
plus_petit = chiffre
|
||||
|
||||
# Trouver le plus grand élément
|
||||
plus_grand = tableau[0]
|
||||
for chiffre in tableau:
|
||||
if chiffre > plus_grand:
|
||||
plus_grand = chiffre
|
||||
|
||||
# Calculer la moyenne
|
||||
moyenne = sum(tableau) / len(tableau)
|
||||
|
||||
# Afficher le tableau
|
||||
print("Le tableau est :")
|
||||
for chiffre in tableau:
|
||||
print(chiffre)
|
||||
|
||||
# Afficher les résultats
|
||||
print(f"Le plus petit élément est : {plus_petit}")
|
||||
print(f"Le plus grand élément est : {plus_grand}")
|
||||
print(f"La moyenne est : {moyenne}")
|
34
sio2/sisr/20-python/exo2-2.py.old
Normal file
34
sio2/sisr/20-python/exo2-2.py.old
Normal file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Etape 1 : Demande à l’utilisateur de saisir 5 chiffres.
|
||||
# Etape 2 : Calcule le plus petit et le plus grand élément du tableau.
|
||||
# Etape 3 : Calcule la moyenne des éléments du tableau.
|
||||
# Etape 4 : Affiche le tableau et les résultats.
|
||||
|
||||
# Initialiser un tableau vide
|
||||
tableau = []
|
||||
|
||||
# Saisir 5 chiffres en utilisant une boucle
|
||||
for i in range(5):
|
||||
chiffre = float(input(f"Entrez le chiffre {i+1} : "))
|
||||
tableau.append(chiffre)
|
||||
|
||||
# Calculer le plus petit élément
|
||||
plus_petit = min(tableau)
|
||||
|
||||
# Calculer le plus grand élément
|
||||
plus_grand = max(tableau)
|
||||
|
||||
# Calculer la moyenne
|
||||
moyenne = sum(tableau) / len(tableau)
|
||||
|
||||
# Afficher le tableau
|
||||
print("Le tableau est :")
|
||||
for chiffre in tableau:
|
||||
print(chiffre)
|
||||
|
||||
# Afficher les résultats
|
||||
print(f"Le plus petit élément est : {plus_petit}")
|
||||
print(f"Le plus grand élément est : {plus_grand}")
|
||||
print(f"La moyenne est : {moyenne}")
|
||||
|
30
sio2/sisr/20-python/exo2.py
Normal file
30
sio2/sisr/20-python/exo2.py
Normal file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Initialiser un tableau vide
|
||||
tableau = []
|
||||
for i in range(5):
|
||||
chiffre = float(input(f"Entrez le chiffre {i+1} : "))
|
||||
tableau.append(chiffre)
|
||||
|
||||
|
||||
mini = tableau[0]
|
||||
maxi = tableau[0]
|
||||
cumul = 0
|
||||
for chiffre in tableau:
|
||||
if chiffre < mini:
|
||||
mini = chiffre
|
||||
if chiffre > maxi:
|
||||
maxi = chiffre
|
||||
cumul+= chiffre
|
||||
|
||||
|
||||
moyenne = cumul / len(tableau)
|
||||
|
||||
|
||||
print("Le tableau est :")
|
||||
for chiffre in tableau:
|
||||
print(chiffre)
|
||||
print(f"Le plus petit élément est : {mini}")
|
||||
print(f"Le plus grand élément est : {maxi}")
|
||||
print(f"La moyenne est : {moyenne}")
|
||||
|
27
sio2/sisr/20-python/exo3.py
Normal file
27
sio2/sisr/20-python/exo3.py
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Etape 1 : Demande à l’utilisateur de saisir une phrase.
|
||||
# Etape 2 : Divise la phrase en mots.
|
||||
# Etape 3 : Utilise un dictionnaire pour compter les occurrences de chaque mot.
|
||||
# Etape 4 : Affiche chaque mot avec son nombre d’occurrences.
|
||||
|
||||
# Demander à l'utilisateur de saisir une phrase
|
||||
phrase = input("Entrez une phrase : ")
|
||||
|
||||
# Convertir la phrase en une liste de mots
|
||||
mots = phrase.split()
|
||||
|
||||
# Créer un dictionnaire pour stocker les occurrences des mots
|
||||
occurrences = {}
|
||||
|
||||
# Compter les occurrences de chaque mot
|
||||
for mot in mots:
|
||||
if mot in occurrences:
|
||||
occurrences[mot] += 1
|
||||
else:
|
||||
occurrences[mot] = 1
|
||||
|
||||
# Afficher les mots et leurs occurrences
|
||||
print("Occurrences des mots :")
|
||||
for mot, count in occurrences.items():
|
||||
print(f"{mot} : {count}")
|
34
sio2/sisr/20-python/exo4-1.py
Normal file
34
sio2/sisr/20-python/exo4-1.py
Normal file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/python3
|
||||
# tips lancement : sudo python exo4-1.py comptes.txt
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
# Fonction pour créer un utilisateur avec le login et le nom complet
|
||||
def create_user(login, full_name):
|
||||
os.system(f'sudo useradd -m -c "{full_name}" -s /bin/bash {login}')
|
||||
print(f"Utilisateur {login} créé avec succès.")
|
||||
res=subprocess.run(["pwgen", "7", "1"],stdout=subprocess.PIPE)
|
||||
pw = res.stdout.decode('utf8').rstrip()
|
||||
os.system(f"echo {login}:{pw}|chpasswd")
|
||||
os.system(f"echo {login}:{pw} >> users.txt.pw")
|
||||
print (pw)
|
||||
|
||||
# Fonction principale pour lire le fichier et créer les utilisateurs
|
||||
def main(filename):
|
||||
try:
|
||||
with open(filename, 'r') as file:
|
||||
for line in file:
|
||||
if line.strip():
|
||||
login, full_name = map(str.strip, line.split(':'))
|
||||
create_user(login, full_name)
|
||||
except FileNotFoundError:
|
||||
print(f"Le fichier {filename} n'a pas été trouvé.")
|
||||
except Exception as e:
|
||||
print(f"Erreur lors de la lecture du fichier {filename}: {e}")
|
||||
|
||||
# Point d'entrée du script
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python exo4-1.py <nom_du_fichier>")
|
||||
else:
|
||||
main(sys.argv[1])
|
37
sio2/sisr/20-python/exo4.py
Normal file
37
sio2/sisr/20-python/exo4.py
Normal file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# tips lancement : sudo python exo4.py comptes.txt
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Fonction pour créer un utilisateur avec le login et le nom complet
|
||||
def create_user(login, full_name):
|
||||
try:
|
||||
# Commande pour créer un utilisateur avec le login et le nom complet
|
||||
os.system(f'sudo useradd -m -c "{full_name}" {login}')
|
||||
print(f"Utilisateur {login} créé avec succès.")
|
||||
except Exception as e:
|
||||
print(f"Erreur lors de la création de l'utilisateur {login}: {e}")
|
||||
|
||||
# Fonction principale pour lire le fichier et créer les utilisateurs
|
||||
def main(filename):
|
||||
try:
|
||||
with open(filename, 'r') as file:
|
||||
for line in file:
|
||||
# Suppression des espaces et découpage de la ligne
|
||||
line = line.strip()
|
||||
if line:
|
||||
login, full_name = line.split(':')
|
||||
create_user(login.strip(), full_name.strip())
|
||||
except FileNotFoundError:
|
||||
print(f"Le fichier {filename} n'a pas été trouvé.")
|
||||
except Exception as e:
|
||||
print(f"Erreur lors de la lecture du fichier {filename}: {e}")
|
||||
|
||||
# Point d'entrée du script
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python exo4.py <nom_du_fichier>")
|
||||
else:
|
||||
main(sys.argv[1])
|
6
sio2/sisr/20-python/users.txt.pw
Normal file
6
sio2/sisr/20-python/users.txt.pw
Normal file
@ -0,0 +1,6 @@
|
||||
t1:EeJ4gie
|
||||
t2:dei5Boo
|
||||
t3:ca1Jaig
|
||||
t1:ve5foSe
|
||||
t2:we6aiBo
|
||||
t3:NahH6ah
|
49
sio2/sisr/Heartbeat/inst-hb1.sh
Normal file
49
sio2/sisr/Heartbeat/inst-hb1.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# les bases
|
||||
# noeud hb1 : 192.168.0.115
|
||||
# noeud hb2 : 192.168.0.116
|
||||
# addr virt. : 192.168.0.117
|
||||
|
||||
sed -i 's/bookworm/hb1/g' /etc/host{s,name}
|
||||
apt update
|
||||
apt install -y heartbeat apache2 net-tools
|
||||
systemctl disable apache2
|
||||
|
||||
cat <<EOT> /etc/network/interfaces.d/enp0s3
|
||||
allow-hotplug enp0s3
|
||||
iface enp0s3 inet static
|
||||
address 192.168.0.115/24 # a adapter pour hb2
|
||||
EOT
|
||||
|
||||
cat <<EOT> /etc/network/interfaces.d/enp0s8
|
||||
allow-hotplug enp0s8
|
||||
iface enp0s8 inet static
|
||||
address 10.0.0.1/24 # a adapter pour hb2
|
||||
EOT
|
||||
|
||||
cd /usr/share/doc/heartbeat
|
||||
gunzip *.gz
|
||||
cp ha.cf /etc/ha.d
|
||||
cp haresources /etc/ha.d
|
||||
cp authkeys /etc/ha.d
|
||||
cd /etc/ha.d
|
||||
echo "192.168.0.116 hb2" >> /etc/hosts # a adapter pour hb2
|
||||
|
||||
cat <<EOT >> /etc/ha.d/ha.cf
|
||||
bcast enp0s8
|
||||
node hb1
|
||||
node hb2
|
||||
pacemaker off
|
||||
EOT
|
||||
|
||||
# echo " hb1 192.168.0.117 apache2" >> /etc/ha.d/haresources pou Debian buster
|
||||
echo " hb1 192.168.0.117/24/enp0s3 apache2" >> /etc/ha.d/haresources
|
||||
|
||||
cat <<EOT >> /etc/ha.d/authkeys
|
||||
auth 1
|
||||
1 crc
|
||||
EOT
|
||||
|
||||
chmod 600 /etc/ha.d/authkeys
|
||||
echo hb1 > /var/www/html/index.html # a adapter pour hb2
|
||||
#
|
49
sio2/sisr/Heartbeat/inst-hb2.sh
Normal file
49
sio2/sisr/Heartbeat/inst-hb2.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# les bases
|
||||
# noeud hb1 : 192.168.0.115
|
||||
# noeud hb2 : 192.168.0.116
|
||||
# addr virt. : 192.168.0.117
|
||||
|
||||
sed -i 's/bookworm/hb2/g' /etc/host{s,name}
|
||||
apt update
|
||||
apt install -y heartbeat apache2 net-tools
|
||||
systemctl disable apache2
|
||||
|
||||
cat <<EOT> /etc/network/interfaces.d/enp0s3
|
||||
allow-hotplug enp0s3
|
||||
iface enp0s3 inet static
|
||||
address 192.168.0.116/24 # a adapter pour hb2
|
||||
EOT
|
||||
|
||||
cat <<EOT> /etc/network/interfaces.d/enp0s8
|
||||
allow-hotplug enp0s8
|
||||
iface enp0s8 inet static
|
||||
address 10.0.0.2/24 # a adapter pour hb2
|
||||
EOT
|
||||
|
||||
cd /usr/share/doc/heartbeat
|
||||
gunzip *.gz
|
||||
cp ha.cf /etc/ha.d
|
||||
cp haresources /etc/ha.d
|
||||
cp authkeys /etc/ha.d
|
||||
cd /etc/ha.d
|
||||
echo "192.168.0.116 hb2" >> /etc/hosts # a adapter pour hb2
|
||||
|
||||
cat <<EOT >> /etc/ha.d/ha.cf
|
||||
bcast enp0s8
|
||||
node hb1
|
||||
node hb2
|
||||
pacemaker off
|
||||
EOT
|
||||
|
||||
# echo " hb1 192.168.0.117 apache2" >> /etc/ha.d/haresources pou Debian buster
|
||||
echo " hb1 192.168.0.117/24/enp0s3 apache2" >> /etc/ha.d/haresources
|
||||
|
||||
cat <<EOT >> /etc/ha.d/authkeys
|
||||
auth 1
|
||||
1 crc
|
||||
EOT
|
||||
|
||||
chmod 600 /etc/ha.d/authkeys
|
||||
echo hb2 > /var/www/html/index.html # a adapter pour hb2
|
||||
#
|
84
sio2/sisr/LVM/LVM-history.txt
Normal file
84
sio2/sisr/LVM/LVM-history.txt
Normal file
@ -0,0 +1,84 @@
|
||||
1 ip a
|
||||
2 ip r
|
||||
3 date
|
||||
4 timedatectl set-timezone Europe/Paris
|
||||
5 date
|
||||
6 apt autoclean
|
||||
7 apt autoremove
|
||||
8 poweroff
|
||||
9 ip a
|
||||
10 ifdown enp0s3
|
||||
11 ifup enp0s3
|
||||
12 ip a
|
||||
13 apt install lvm2
|
||||
14 lsblk
|
||||
15 fdisk /dev/sdb
|
||||
16 fdisk /dev/sdb
|
||||
17 lsblk
|
||||
18 cat /dev/sdb
|
||||
19 clear
|
||||
20 fdisk /dev/sdb
|
||||
21 lsblk
|
||||
22 fdisk /dev/sdb
|
||||
23 fdisk /dev/sdb
|
||||
24 lsblk
|
||||
25 sfdisk -d /dev/sdb | sfdisk -f /dev/sdc
|
||||
26 sfdisk -d /dev/sdb | sfdisk -f /dev/sdd
|
||||
27 lsblk
|
||||
28 pvcreate /dev/sdb1
|
||||
29 pvcreate /dev/sdc1
|
||||
30 pvcreate /dev/sdd1
|
||||
31 pvs
|
||||
32 vgcreate vg0 /dev/sdb1 /dev/sdc1
|
||||
33 vgs
|
||||
34 vgdisplay
|
||||
35 vgs
|
||||
36 pvs
|
||||
37 lvs
|
||||
38 lvs
|
||||
39 vgs
|
||||
40 lvcreate -n Vol1 -L 196m mvg
|
||||
41 lvcreate -n Vol1 -L 196,00m mvg
|
||||
42 man lvcreate
|
||||
43 lvcreate -n Vol1 -L 200 mvg
|
||||
44 lvcreate -n Vol1 -L 200 vg0
|
||||
45 lvcreate -n Vol2 -L 250 vg0
|
||||
46 lvcreate -n Vol2 -L 200 vg0
|
||||
47 lvcreate -n Vol2 -L 196 vg0
|
||||
48 lvcreate -n Vol2 -L 192 vg0
|
||||
49 lvs
|
||||
50 mkfs /dev/vg0-Vol1
|
||||
51 mkfs /dev/vg0/Vol1
|
||||
52 mkfs /dev/vg0/Vol2
|
||||
53 lvs
|
||||
54 mount /dev/vg0/Vol1 /lvs1
|
||||
55 mkdir /lvs1
|
||||
56 mkdir /lvs2
|
||||
57 mount /dev/vg0/Vol1 /lvs1
|
||||
58 mount /dev/vg0/Vol2 /lvs2
|
||||
59 lsblk
|
||||
60 df -h
|
||||
61 pvcreate /dev/sdd1
|
||||
62 vgextend /dev/vg0
|
||||
63 vgextend /dev/vg0
|
||||
64 vgextend vg0 /dev/sdd1
|
||||
65 lvresize --resizefs --size +200m /dev/vg0/Vol2
|
||||
66 lvresize --resizefs --size +100 /dev/vg0/Vol2
|
||||
67 lvresize --resizefs --size +100 /dev/vg0/Vol1
|
||||
68 lvresize --resizefs --size +90 /dev/vg0/Vol1
|
||||
69 lsblk
|
||||
70 df -h
|
||||
71 resize2fs -PM /dev/vg0/Vol1
|
||||
72 vgs
|
||||
73 lv
|
||||
74 lvs
|
||||
75 df -h
|
||||
76 history > historyLVM.txt
|
||||
77 ls
|
||||
78 nano /etc/ssh/ssh_config
|
||||
79 nano /etc/ssh/sshd_config
|
||||
80 systemctl restart ssh
|
||||
81 ip a
|
||||
82 history
|
||||
83 ls
|
||||
84 history > LVM-history.txt
|
20
sio2/sisr/OpenVPN-Config/ca.crt
Normal file
20
sio2/sisr/OpenVPN-Config/ca.crt
Normal file
@ -0,0 +1,20 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDRTCCAi2gAwIBAgIUIUykYibk8h5ODHnE8zLMZKtGYDwwDQYJKoZIhvcNAQEL
|
||||
BQAwFDESMBAGA1UEAwwJU2VydmVyLUNBMB4XDTI0MTAxNDA5Mzg0OVoXDTM0MTAx
|
||||
MjA5Mzg0OVowFDESMBAGA1UEAwwJU2VydmVyLUNBMIIBIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAQ8AMIIBCgKCAQEAuc/MtP9vRo2M3KK/wAbwcNapMTCzGWZmqrcWYBw55q9H
|
||||
IJ93LUMytawnYeX7W+p8jhtPfQxJC5pFm5Gy2fU+Qx7+iYVLVyi0WBe4dYePRTXf
|
||||
NS+sBad6t5viH6Lrh3s2qwwijItUCk66PKVxzUOZvMRoJHk1ynz9lArxmjFRLI8G
|
||||
Ie2ETWbidmv3DfOEOrSetp6LPETaSBTPZUoBKzH6UYM9d0zdkFIHFHdAGG3/G7zw
|
||||
l9e9xaZ9vE1Qi0mproBojDNDsrzCS2S5FYyaoPGQrFLpfbi+AWV003rxTLcgV7Xe
|
||||
sLcFxyGScDxexf+NVZs0M1bG7byQpSS53ZqljXTYYQIDAQABo4GOMIGLMAwGA1Ud
|
||||
EwQFMAMBAf8wHQYDVR0OBBYEFI/gDJLpIGZinm4Bw/R+OGFX0dD6ME8GA1UdIwRI
|
||||
MEaAFI/gDJLpIGZinm4Bw/R+OGFX0dD6oRikFjAUMRIwEAYDVQQDDAlTZXJ2ZXIt
|
||||
Q0GCFCFMpGIm5PIeTgx5xPMyzGSrRmA8MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0B
|
||||
AQsFAAOCAQEAteSl9CPpX5A1aWeSB59QecqJ9gB2YS8Xk6t7IloLUMrzLUQojNoh
|
||||
u+MYkzyZMlawwgxB3zD5KcnDY2cJqO7Hs0guf59jd2gZrmNuCwPyq6sQfIcgFCtb
|
||||
gJkZy+lR613KB7zmfGIvcno5FR7ATa6u2eN9P9l82cTah1g0o0Y+6xm0YGmkCqtQ
|
||||
/pt8qjUDIBDMminHckKIoi6PR8xaxk1YTidwB19Eq920lJgO0x2ZDUOT3TcYfzas
|
||||
5U3IqF4DwnJyC1Cw4kSp/WbKYmJ2Cjh5A2kw51PP3/jwQV+paQwpnCzS2iRcBpNM
|
||||
751g2TKjH0YxTyct6bcPDmXoOZcVbNJ1iQ==
|
||||
-----END CERTIFICATE-----
|
120
sio2/sisr/OpenVPN-Config/client - Test2.ovpn
Normal file
120
sio2/sisr/OpenVPN-Config/client - Test2.ovpn
Normal file
@ -0,0 +1,120 @@
|
||||
##############################################
|
||||
# Sample client-side OpenVPN 2.6 config file #
|
||||
# for connecting to multi-client server. #
|
||||
# #
|
||||
# This configuration can be used by multiple #
|
||||
# clients, however each client should have #
|
||||
# its own cert and key files. #
|
||||
# #
|
||||
# On Windows, you might want to rename this #
|
||||
# file so it has a .ovpn extension #
|
||||
##############################################
|
||||
|
||||
# Specify that we are a client and that we
|
||||
# will be pulling certain config file directives
|
||||
# from the server.
|
||||
client
|
||||
|
||||
# Use the same setting as you are using on
|
||||
# the server.
|
||||
# On most systems, the VPN will not function
|
||||
# unless you partially or fully disable
|
||||
# the firewall for the TUN/TAP interface.
|
||||
;dev tap
|
||||
dev tun
|
||||
|
||||
# Windows needs the TAP-Win32 adapter name
|
||||
# from the Network Connections panel
|
||||
# if you have more than one. On XP SP2,
|
||||
# you may need to disable the firewall
|
||||
# for the TAP adapter.
|
||||
;dev-node MyTap
|
||||
|
||||
# Are we connecting to a TCP or
|
||||
# UDP server? Use the same setting as
|
||||
# on the server.
|
||||
;proto tcp
|
||||
proto udp
|
||||
|
||||
# The hostname/IP and port of the server.
|
||||
# You can have multiple remote entries
|
||||
# to load balance between the servers.
|
||||
remote 192.168.0.39 1194
|
||||
;remote my-server-2 1194
|
||||
|
||||
# Choose a random host from the remote
|
||||
# list for load-balancing. Otherwise
|
||||
# try hosts in the order specified.
|
||||
;remote-random
|
||||
|
||||
# Keep trying indefinitely to resolve the
|
||||
# host name of the OpenVPN server. Very useful
|
||||
# on machines which are not permanently connected
|
||||
# to the internet such as laptops.
|
||||
resolv-retry infinite
|
||||
|
||||
# Most clients don't need to bind to
|
||||
# a specific local port number.
|
||||
nobind
|
||||
|
||||
# Downgrade privileges after initialization (non-Windows only)
|
||||
;user openvpn
|
||||
;group openvpn
|
||||
|
||||
# Try to preserve some state across restarts.
|
||||
persist-key
|
||||
persist-tun
|
||||
|
||||
# If you are connecting through an
|
||||
# HTTP proxy to reach the actual OpenVPN
|
||||
# server, put the proxy server/IP and
|
||||
# port number here. See the man page
|
||||
# if your proxy server requires
|
||||
# authentication.
|
||||
;http-proxy-retry # retry on connection failures
|
||||
;http-proxy [proxy server] [proxy port #]
|
||||
|
||||
# Wireless networks often produce a lot
|
||||
# of duplicate packets. Set this flag
|
||||
# to silence duplicate packet warnings.
|
||||
;mute-replay-warnings
|
||||
|
||||
# SSL/TLS parms.
|
||||
# See the server config file for more
|
||||
# description. It's best to use
|
||||
# a separate .crt/.key file pair
|
||||
# for each client. A single ca
|
||||
# file can be used for all clients.
|
||||
ca ca.crt
|
||||
cert client1.crt
|
||||
key client1.key
|
||||
|
||||
# Verify server certificate by checking that the
|
||||
# certificate has the correct key usage set.
|
||||
# This is an important precaution to protect against
|
||||
# a potential attack discussed here:
|
||||
# http://openvpn.net/howto.html#mitm
|
||||
#
|
||||
# To use this feature, you will need to generate
|
||||
# your server certificates with the keyUsage set to
|
||||
# digitalSignature, keyEncipherment
|
||||
# and the extendedKeyUsage to
|
||||
# serverAuth
|
||||
# EasyRSA can do this for you.
|
||||
remote-cert-tls server
|
||||
|
||||
# Allow to connect to really old OpenVPN versions
|
||||
# without AEAD support (OpenVPN 2.3.x or older)
|
||||
# This adds AES-256-CBC as fallback cipher and
|
||||
# keeps the modern ciphers as well.
|
||||
data-ciphers AES-256-GCM:AES-128-GCM:?CHACHA20-POLY1305:AES-256-CBC
|
||||
|
||||
# If a tls-auth key is used on the server
|
||||
# then every client must also have the key.
|
||||
tls-auth ta.key 1
|
||||
|
||||
# Set log file verbosity.
|
||||
verb 3
|
||||
|
||||
# Silence repeating messages
|
||||
;mute 20
|
84
sio2/sisr/OpenVPN-Config/client1.crt
Normal file
84
sio2/sisr/OpenVPN-Config/client1.crt
Normal file
@ -0,0 +1,84 @@
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number:
|
||||
18:f8:33:fa:b5:e8:c7:54:34:98:3d:bc:a5:59:c3:be
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
Issuer: CN=Server-CA
|
||||
Validity
|
||||
Not Before: Oct 14 09:41:16 2024 GMT
|
||||
Not After : Jan 17 09:41:16 2027 GMT
|
||||
Subject: CN=client1
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
Public-Key: (2048 bit)
|
||||
Modulus:
|
||||
00:b5:b0:68:84:0b:8b:91:1f:2a:06:4a:53:39:e1:
|
||||
a5:42:b8:66:24:bb:05:5a:78:22:e6:ea:46:90:f7:
|
||||
f4:9a:85:b3:ff:34:51:8c:d3:e5:75:01:ea:e6:97:
|
||||
19:fa:a0:d3:76:79:40:05:d6:27:ad:36:74:7a:1e:
|
||||
52:d1:65:b6:c3:0d:86:0a:99:25:e6:cd:f1:33:9d:
|
||||
57:3a:6d:41:02:0e:3d:bb:58:44:03:2d:35:b6:63:
|
||||
b0:75:fd:38:ce:7d:58:7e:93:53:47:5b:f4:83:6d:
|
||||
f5:8c:c5:cd:23:b9:d7:31:71:a9:f5:7c:9b:e1:c7:
|
||||
78:f1:4b:06:57:14:5f:61:59:50:36:52:ff:c3:9b:
|
||||
a8:6e:94:7d:24:41:1a:06:33:37:b1:00:60:14:e1:
|
||||
6e:ed:65:65:df:fc:24:f8:54:2f:44:3f:1c:0b:58:
|
||||
1c:7b:f3:e2:3b:9d:73:de:f6:a2:c9:7d:b3:41:b3:
|
||||
e0:e3:2a:1e:b8:d3:d3:52:82:48:02:aa:96:52:2b:
|
||||
d2:97:01:85:38:b4:83:d8:58:ab:a4:6a:ac:fe:e4:
|
||||
cc:4c:36:16:d5:80:21:38:f4:5e:be:94:31:e3:cc:
|
||||
51:b2:28:36:22:e2:29:6b:fa:db:35:b9:28:59:69:
|
||||
5e:75:59:e4:94:3a:04:cc:2a:00:e9:9c:6e:a6:bf:
|
||||
93:51
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Basic Constraints:
|
||||
CA:FALSE
|
||||
X509v3 Subject Key Identifier:
|
||||
3B:04:C8:59:A9:07:2E:AF:4D:7C:D3:C0:D6:57:33:D4:A1:09:B0:F0
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:8F:E0:0C:92:E9:20:66:62:9E:6E:01:C3:F4:7E:38:61:57:D1:D0:FA
|
||||
DirName:/CN=Server-CA
|
||||
serial:21:4C:A4:62:26:E4:F2:1E:4E:0C:79:C4:F3:32:CC:64:AB:46:60:3C
|
||||
X509v3 Extended Key Usage:
|
||||
TLS Web Client Authentication
|
||||
X509v3 Key Usage:
|
||||
Digital Signature
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
Signature Value:
|
||||
5d:e7:ad:a5:48:23:4f:85:36:e2:30:99:cd:ee:6d:eb:b6:69:
|
||||
92:a2:56:54:9b:43:f6:60:6e:e0:41:c4:20:b1:ab:48:d1:1f:
|
||||
d0:c2:86:d5:84:27:6a:18:c6:bf:2d:df:af:9b:8b:f1:c2:07:
|
||||
27:5f:4d:d0:4e:d3:5f:21:38:20:99:68:12:47:bd:1f:d8:fd:
|
||||
a9:02:44:49:c2:4c:0d:bf:51:a0:59:70:49:a6:7c:b0:35:b3:
|
||||
73:6b:ce:98:b8:98:c6:b8:a6:38:6d:97:fd:61:21:a4:18:64:
|
||||
48:55:c3:94:de:e6:32:13:cc:60:bd:e5:52:2d:b0:ef:71:ef:
|
||||
37:22:4d:82:9c:34:f7:a5:a5:5a:0b:cd:6f:6f:58:15:ce:74:
|
||||
37:fe:a0:a1:1a:5c:49:fa:0c:60:9e:8a:97:ea:0f:d5:d3:72:
|
||||
84:98:da:3f:d1:ad:43:12:a6:27:18:0c:25:d5:8e:2f:14:a7:
|
||||
fb:89:a6:3a:d0:53:cd:65:6a:56:33:c3:c3:53:06:88:d7:f8:
|
||||
46:c7:c4:41:bc:75:f4:61:b3:a4:11:5c:64:2e:77:d7:e7:82:
|
||||
6b:10:4e:c7:d5:14:48:18:18:12:48:ee:26:f2:10:ef:b5:69:
|
||||
5c:ce:92:5d:fc:37:41:90:4d:ff:f0:80:93:e7:92:31:0a:a1:
|
||||
e5:53:a3:c9
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDUTCCAjmgAwIBAgIQGPgz+rXox1Q0mD28pVnDvjANBgkqhkiG9w0BAQsFADAU
|
||||
MRIwEAYDVQQDDAlTZXJ2ZXItQ0EwHhcNMjQxMDE0MDk0MTE2WhcNMjcwMTE3MDk0
|
||||
MTE2WjASMRAwDgYDVQQDDAdjbGllbnQxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
|
||||
MIIBCgKCAQEAtbBohAuLkR8qBkpTOeGlQrhmJLsFWngi5upGkPf0moWz/zRRjNPl
|
||||
dQHq5pcZ+qDTdnlABdYnrTZ0eh5S0WW2ww2GCpkl5s3xM51XOm1BAg49u1hEAy01
|
||||
tmOwdf04zn1YfpNTR1v0g231jMXNI7nXMXGp9Xyb4cd48UsGVxRfYVlQNlL/w5uo
|
||||
bpR9JEEaBjM3sQBgFOFu7WVl3/wk+FQvRD8cC1gce/PiO51z3vaiyX2zQbPg4yoe
|
||||
uNPTUoJIAqqWUivSlwGFOLSD2FirpGqs/uTMTDYW1YAhOPRevpQx48xRsig2IuIp
|
||||
a/rbNbkoWWledVnklDoEzCoA6Zxupr+TUQIDAQABo4GgMIGdMAkGA1UdEwQCMAAw
|
||||
HQYDVR0OBBYEFDsEyFmpBy6vTXzTwNZXM9ShCbDwME8GA1UdIwRIMEaAFI/gDJLp
|
||||
IGZinm4Bw/R+OGFX0dD6oRikFjAUMRIwEAYDVQQDDAlTZXJ2ZXItQ0GCFCFMpGIm
|
||||
5PIeTgx5xPMyzGSrRmA8MBMGA1UdJQQMMAoGCCsGAQUFBwMCMAsGA1UdDwQEAwIH
|
||||
gDANBgkqhkiG9w0BAQsFAAOCAQEAXeetpUgjT4U24jCZze5t67ZpkqJWVJtD9mBu
|
||||
4EHEILGrSNEf0MKG1YQnahjGvy3fr5uL8cIHJ19N0E7TXyE4IJloEke9H9j9qQJE
|
||||
ScJMDb9RoFlwSaZ8sDWzc2vOmLiYxrimOG2X/WEhpBhkSFXDlN7mMhPMYL3lUi2w
|
||||
73HvNyJNgpw096WlWgvNb29YFc50N/6goRpcSfoMYJ6Kl+oP1dNyhJjaP9GtQxKm
|
||||
JxgMJdWOLxSn+4mmOtBTzWVqVjPDw1MGiNf4RsfEQbx19GGzpBFcZC531+eCaxBO
|
||||
x9UUSBgYEkjuJvIQ77VpXM6SXfw3QZBN//CAk+eSMQqh5VOjyQ==
|
||||
-----END CERTIFICATE-----
|
28
sio2/sisr/OpenVPN-Config/client1.key
Normal file
28
sio2/sisr/OpenVPN-Config/client1.key
Normal file
@ -0,0 +1,28 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC1sGiEC4uRHyoG
|
||||
SlM54aVCuGYkuwVaeCLm6kaQ9/SahbP/NFGM0+V1Aermlxn6oNN2eUAF1ietNnR6
|
||||
HlLRZbbDDYYKmSXmzfEznVc6bUECDj27WEQDLTW2Y7B1/TjOfVh+k1NHW/SDbfWM
|
||||
xc0judcxcan1fJvhx3jxSwZXFF9hWVA2Uv/Dm6hulH0kQRoGMzexAGAU4W7tZWXf
|
||||
/CT4VC9EPxwLWBx78+I7nXPe9qLJfbNBs+DjKh6409NSgkgCqpZSK9KXAYU4tIPY
|
||||
WKukaqz+5MxMNhbVgCE49F6+lDHjzFGyKDYi4ilr+ts1uShZaV51WeSUOgTMKgDp
|
||||
nG6mv5NRAgMBAAECggEAS3OG888XlpyqhxI2ncLnLl4FjRtdjcR2Og7wXyOZoNIF
|
||||
feXsN9+HWqABPOFjGIHRT1HrFIFq2LPUiyIsomjrDPWAxMX0x3SexiCBKPJWHNRt
|
||||
Lm/pTqhnteaQUW9nN9k19tqXqvq1AB+Z6Wv7VOrIQvBA9IFa+tgrkYjmiSMcuP/5
|
||||
rzw3CkXslbgP4dnqBL9Q30wr0ltZEh+Y2WK0FL7W6Piu7fmTsiK5XEkqMkgOAqT4
|
||||
XohCN/amAJfQ3/0y5p411L4IXEFz9VO1Qh+SbYLVguz8QgJbiyNZIu8Z2YyM8XmV
|
||||
SHDiyfU9vsy9OJ6kSClFKSYWrQu7mfcj5dKbJW0wQQKBgQDzaBQeQqT8RQUY1m8n
|
||||
vqrmPh30pug7A73l5i/NlVUo62xN1k8Vl7wewBy4XeXRC3irIVg4Y9bSP9LJ5cMb
|
||||
Vigl8ZP+5RRPI/lQKDRDj1c9N8sfLh0GjKNseTy5JJZk+Zgj8R0Mz1Q/lSDh+GCg
|
||||
CI4XR9Tspe9QtDd5lGNpDBrzkwKBgQC/FuGpm3rlsbf5Wx9XlAyN9nLx/XuUGxZQ
|
||||
omZTjdxzYsKgsZGqOVccItW0LCmmJa+YRa0SS+vsr850gdW451gulMe2jUNLieX+
|
||||
qEVSvSJ1SsOZHE4QAdYxwUueS9JlPTfgrd9CqKlh5mehmTCHWU68i3nVSVJMMfVB
|
||||
+ympbDX0CwKBgQCbT0iu+kU9tmiHLaQlTxLK8M26YpmBtmSAAf10hxmcj4M+s0Uo
|
||||
+PWPBXQN69QNK+2l/BPHf2T+KL0+GD4C/lmFxHxzQwZPbRvSmqSmixrWM/iGf60D
|
||||
lc9dEoq9c+wGp//8xweLOet+2o/tv8cftfW8QxhIm6R08VkIWbeIurGjwwKBgBFX
|
||||
BzU32agcP2COR0LQOW9sbLPO17bx2k2I3xY36khCLv0b/+bdey0fcBsAYusjwlJk
|
||||
CDd/0jHRJj/mRDmaLKNVduX23aNuKQO5y0idxxGzrhonumGzePdc3frIUJhFPNvT
|
||||
i03mNjCfEspUN1Yg4Yc0dOLI24H0ipfpLbelDSRPAoGBAJpASzBZrr/XWCcPMUuk
|
||||
BzxAuxTO75lCMSDuQz5+Os06A/3QE+0het0IY53gRSbQV572W/a88Tvmxirx2zUm
|
||||
EUtvZlZ7xnpe7Mc8pVKo+aQkuwNJ8J54GmV9POj5Mz3yqiTYzUEdyg/+UtsS25ut
|
||||
DeCxwsBX+CPRofRh+lGsdWeB
|
||||
-----END PRIVATE KEY-----
|
21
sio2/sisr/OpenVPN-Config/ta.key
Normal file
21
sio2/sisr/OpenVPN-Config/ta.key
Normal file
@ -0,0 +1,21 @@
|
||||
#
|
||||
# 2048 bit OpenVPN static key
|
||||
#
|
||||
-----BEGIN OpenVPN Static key V1-----
|
||||
2866aa1fbdcd51ad2da0b923890212ba
|
||||
4934cd87bee0cf01bdb8a6f341f0f898
|
||||
6ffa5707caf30128c13e355a8d128150
|
||||
7bca1b696735e67ff2add932bdc3c231
|
||||
214e563420562ee99215eb62adbcc393
|
||||
06da368fb8011fc73d30b540d9b845ce
|
||||
5f0e3a6ac194420f0bf51e2e16fb3dd5
|
||||
70ddb015225a3ed38e0637fa52216601
|
||||
3dcc67804ef1dc11ed57024fe4e6148b
|
||||
bb2604f35078d208f8f10f63f32fcc58
|
||||
3abc9d3d4fd5c3cc4d716e650d67160c
|
||||
11150e10d6137752762827af18fd4b17
|
||||
36cc686880e867c05ac75cb6ee608c73
|
||||
3b5f35580a79f141fdb97aad0a9bb88c
|
||||
f1919e8956f4fca61f1f09f664a1915a
|
||||
e0e9441ffea3e26c86a8b6100bd613a6
|
||||
-----END OpenVPN Static key V1-----
|
38
sio2/sisr/PXE/README.me
Normal file
38
sio2/sisr/PXE/README.me
Normal file
@ -0,0 +1,38 @@
|
||||
# TP Déploiement PXE
|
||||
|
||||
## Description
|
||||
Ce projet décrit comment installer et configurer un serveur PXE (Preboot Execution Environment) pour permettre le démarrage de machines via le réseau.
|
||||
|
||||
## Prérequis
|
||||
- Un serveur avec une distribution Linux (par exemple, Ubuntu ou Debian)
|
||||
- Accès root ou sudo
|
||||
- Une connexion réseau fonctionnelle
|
||||
|
||||
## Installation
|
||||
|
||||
### Étape 1 : Installer les paquets nécessaires
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt install -y isc-dhcp-server tftpd-hpa
|
||||
|
||||
### Étape 2 : Modifier le fichier isc-dhcp-server
|
||||
```
|
||||
--> Voir fichier dhcpd.conf
|
||||
|
||||
### Étape 3 : Configurer nftables
|
||||
```
|
||||
--> Voir /etc/nftables.conf
|
||||
|
||||
### Étape 4 : Configurer TFTP
|
||||
```
|
||||
YOURMIRROR=deb.debian.org
|
||||
Utiliser le script ci-dessous afin de récupérer l'image de netboot
|
||||
DIST=bookworm
|
||||
ARCH=amd64
|
||||
wget http://"$YOURMIRROR"/debian/dists/"$DIST"/main/installer-"$ARCH"/current/images/netboot/netboot.tar.gz
|
||||
|
||||
L'extraire dans /srv/tftp
|
||||
|
||||
|
||||
|
||||
|
15
sio2/sisr/PXE/dhcpd.conf
Normal file
15
sio2/sisr/PXE/dhcpd.conf
Normal file
@ -0,0 +1,15 @@
|
||||
default-lease-time 600;
|
||||
max-lease-time 7200;
|
||||
|
||||
allow booting;
|
||||
|
||||
# in this example, we serve DHCP requests from 192.168.0.(3 to 253)
|
||||
# and we have a router at 192.168.0.1
|
||||
subnet 192.168.1.0 netmask 255.255.255.0 {
|
||||
range 192.168.1.3 192.168.1.253;
|
||||
option broadcast-address 192.168.1.255;
|
||||
option routers 192.168.1.100; # our router
|
||||
option domain-name-servers 10.121.38.7; # our router has DNS functionality
|
||||
next-server 192.168.1.100; # our Server
|
||||
filename "pxelinux.0"; # setting a default, might be wrong for "non defaults"
|
||||
}
|
3
sio2/sisr/PXE/enp0s3
Normal file
3
sio2/sisr/PXE/enp0s3
Normal file
@ -0,0 +1,3 @@
|
||||
# generated by FAI
|
||||
auto enp0s3
|
||||
iface enp0s3 inet dhcp
|
4
sio2/sisr/PXE/enp0s8
Normal file
4
sio2/sisr/PXE/enp0s8
Normal file
@ -0,0 +1,4 @@
|
||||
# generated by FAI
|
||||
auto enp0s8
|
||||
iface enp0s8 inet static
|
||||
address 192.168.1.100/24
|
18
sio2/sisr/PXE/isc-dhcp-server
Normal file
18
sio2/sisr/PXE/isc-dhcp-server
Normal file
@ -0,0 +1,18 @@
|
||||
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
|
||||
|
||||
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
|
||||
DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
|
||||
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
|
||||
|
||||
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
|
||||
DHCPDv4_PID=/var/run/dhcpd.pid
|
||||
#DHCPDv6_PID=/var/run/dhcpd6.pid
|
||||
|
||||
# Additional options to start dhcpd with.
|
||||
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
|
||||
#OPTIONS=""
|
||||
|
||||
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
|
||||
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
|
||||
INTERFACESv4="enp0s8"
|
||||
#INTERFACESv6=""
|
14
sio2/sisr/PXE/nftables.conf
Normal file
14
sio2/sisr/PXE/nftables.conf
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/sbin/nft -f
|
||||
|
||||
flush ruleset
|
||||
|
||||
table inet nat {
|
||||
chain prerouting {
|
||||
type nat hook prerouting priority 0;
|
||||
}
|
||||
chain postrouting {
|
||||
type nat hook postrouting priority 100;
|
||||
oifname "enp0s3" masquerade
|
||||
}
|
||||
}
|
||||
|
19
sio2/sisr/Raid5/history.txt
Normal file
19
sio2/sisr/Raid5/history.txt
Normal file
@ -0,0 +1,19 @@
|
||||
11 lsblk
|
||||
15 apt install mdadm
|
||||
20 lsblk
|
||||
28 fdisk /dev/sdb
|
||||
29 parted /dev/sdb mklabel msdos mkpart primary ext4 0.0 100%
|
||||
30 reboot
|
||||
31 ldbsk
|
||||
32 lsblk
|
||||
33 fdisk /dev/sdb
|
||||
34 fdisk /dev/sdb
|
||||
35 lsblk
|
||||
36 sfdisk -d /dev/sdb | sfdisk -f /dev/sdc
|
||||
37 sfdisk -d /dev/sdb | sfdisk -f /dev/sdd
|
||||
38 sfdisk -d /dev/sdb | sfdisk -f /dev/sde
|
||||
39 lsblk
|
||||
40 mdadm --create /dev/md0 --level=5 --assume-clean --raid-services=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
|
||||
41 mdadm --create /dev/md0 --level=5 --assume-clean --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
|
||||
42 cat /proc/mdstat
|
||||
|
42
sio2/sisr/Raid5/history2.txt
Normal file
42
sio2/sisr/Raid5/history2.txt
Normal file
@ -0,0 +1,42 @@
|
||||
11 lsblk
|
||||
15 apt install mdadm
|
||||
20 lsblk
|
||||
21 parted /dev/sdb/ mklabel msdos mkpart PARTTYPE1 ext4 0.0 100%
|
||||
22 parted /dev/sdb mklabel msdos mkpart PARTTYPE1 ext4 0.0 100%
|
||||
23 parted /dev/sdb mklabel msdos mkpart primary ext4 0.0 100%
|
||||
24 lsblk
|
||||
25 sync;
|
||||
26 sync;
|
||||
27 lsblk
|
||||
28 fdisk /dev/sdb
|
||||
29 parted /dev/sdb mklabel msdos mkpart primary ext4 0.0 100%
|
||||
30 reboot
|
||||
31 ldbsk
|
||||
32 lsblk
|
||||
33 fdisk /dev/sdb
|
||||
34 fdisk /dev/sdb
|
||||
35 lsblk
|
||||
36 sfdisk -d /dev/sdb | sfdisk -f /dev/sdc
|
||||
37 sfdisk -d /dev/sdb | sfdisk -f /dev/sdd
|
||||
38 sfdisk -d /dev/sdb | sfdisk -f /dev/sde
|
||||
39 lsblk
|
||||
40 mdadm --create /dev/md0 --level=5 --assume-clean --raid-services=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
|
||||
41 mdadm --create /dev/md0 --level=5 --assume-clean --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
|
||||
42 cat /proc/mdstat
|
||||
43 history > history.txt
|
||||
44 ls
|
||||
45 nano history.txt
|
||||
46 clear
|
||||
47 cat /proc/mdstat
|
||||
48 mdadm --add /dev/md0 /dev/sde1
|
||||
49 cat /proc/mdstat
|
||||
50 fdisk
|
||||
51 fdisk /dev/md0
|
||||
52 lsblk
|
||||
53 fdisk /dev/md0
|
||||
54 fdisk /dev/md0p1
|
||||
55 mkfs.ext4 /dev/md0p1
|
||||
56 mount help
|
||||
57 mount /dev/md0p1 /mnt
|
||||
58 df -h
|
||||
59 history > history2.txt
|
70
sio2/sisr/Raid5/history3.txt
Normal file
70
sio2/sisr/Raid5/history3.txt
Normal file
@ -0,0 +1,70 @@
|
||||
1 ip a
|
||||
2 ip r
|
||||
3 date
|
||||
4 timedatectl set-timezone Europe/Paris
|
||||
5 date
|
||||
6 apt autoclean
|
||||
7 apt autoremove
|
||||
8 poweroff
|
||||
9 fdisk -l |more
|
||||
10 fdisk -l |more
|
||||
11 lsblk
|
||||
12 ifdown enp0s3
|
||||
13 ifup enp0s3
|
||||
14 ip a
|
||||
15 apt install mdadm
|
||||
16 lsblk
|
||||
17 apt install partd
|
||||
18 apt install parted
|
||||
19 parted
|
||||
20 lsblk
|
||||
21 parted /dev/sdb/ mklabel msdos mkpart PARTTYPE1 ext4 0.0 100%
|
||||
22 parted /dev/sdb mklabel msdos mkpart PARTTYPE1 ext4 0.0 100%
|
||||
23 parted /dev/sdb mklabel msdos mkpart primary ext4 0.0 100%
|
||||
24 lsblk
|
||||
25 sync;
|
||||
26 sync;
|
||||
27 lsblk
|
||||
28 fdisk /dev/sdb
|
||||
29 parted /dev/sdb mklabel msdos mkpart primary ext4 0.0 100%
|
||||
30 reboot
|
||||
31 ldbsk
|
||||
32 lsblk
|
||||
33 fdisk /dev/sdb
|
||||
34 fdisk /dev/sdb
|
||||
35 lsblk
|
||||
36 sfdisk -d /dev/sdb | sfdisk -f /dev/sdc
|
||||
37 sfdisk -d /dev/sdb | sfdisk -f /dev/sdd
|
||||
38 sfdisk -d /dev/sdb | sfdisk -f /dev/sde
|
||||
39 lsblk
|
||||
40 mdadm --create /dev/md0 --level=5 --assume-clean --raid-services=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
|
||||
41 mdadm --create /dev/md0 --level=5 --assume-clean --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
|
||||
42 cat /proc/mdstat
|
||||
43 history > history.txt
|
||||
44 ls
|
||||
45 nano history.txt
|
||||
46 clear
|
||||
47 cat /proc/mdstat
|
||||
48 mdadm --add /dev/md0 /dev/sde1
|
||||
49 cat /proc/mdstat
|
||||
50 fdisk
|
||||
51 fdisk /dev/md0
|
||||
52 lsblk
|
||||
53 fdisk /dev/md0
|
||||
54 fdisk /dev/md0p1
|
||||
55 mkfs.ext4 /dev/md0p1
|
||||
56 mount help
|
||||
57 mount /dev/md0p1 /mnt
|
||||
58 df -h
|
||||
59 history > history2.txt
|
||||
60 nano history2.txt
|
||||
61 clear
|
||||
62 ls
|
||||
63 ../mnt/
|
||||
64 cd ../mnt/
|
||||
65 ls
|
||||
66 touch test
|
||||
67 cd
|
||||
68 clear
|
||||
69 dd if=/dev/zero of=/mnt/fic bs=1M count=50
|
||||
70 history > history3.txt
|
73
sio2/sisr/Raid5/lasthistory.txt
Normal file
73
sio2/sisr/Raid5/lasthistory.txt
Normal file
@ -0,0 +1,73 @@
|
||||
1 ip a
|
||||
2 ip r
|
||||
3 date
|
||||
4 timedatectl set-timezone Europe/Paris
|
||||
5 date
|
||||
6 apt autoclean
|
||||
7 apt autoremove
|
||||
8 poweroff
|
||||
9 fdisk -l |more
|
||||
10 fdisk -l |more
|
||||
11 lsblk
|
||||
12 ifdown enp0s3
|
||||
13 ifup enp0s3
|
||||
14 ip a
|
||||
15 apt install mdadm
|
||||
16 lsblk
|
||||
17 apt install partd
|
||||
18 apt install parted
|
||||
19 parted
|
||||
20 lsblk
|
||||
21 parted /dev/sdb/ mklabel msdos mkpart PARTTYPE1 ext4 0.0 100%
|
||||
22 parted /dev/sdb mklabel msdos mkpart PARTTYPE1 ext4 0.0 100%
|
||||
23 parted /dev/sdb mklabel msdos mkpart primary ext4 0.0 100%
|
||||
24 lsblk
|
||||
25 sync;
|
||||
26 sync;
|
||||
27 lsblk
|
||||
28 fdisk /dev/sdb
|
||||
29 parted /dev/sdb mklabel msdos mkpart primary ext4 0.0 100%
|
||||
30 reboot
|
||||
31 ldbsk
|
||||
32 lsblk
|
||||
33 fdisk /dev/sdb
|
||||
34 fdisk /dev/sdb
|
||||
35 lsblk
|
||||
36 sfdisk -d /dev/sdb | sfdisk -f /dev/sdc
|
||||
37 sfdisk -d /dev/sdb | sfdisk -f /dev/sdd
|
||||
38 sfdisk -d /dev/sdb | sfdisk -f /dev/sde
|
||||
39 lsblk
|
||||
40 mdadm --create /dev/md0 --level=5 --assume-clean --raid-services=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
|
||||
41 mdadm --create /dev/md0 --level=5 --assume-clean --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
|
||||
42 cat /proc/mdstat
|
||||
43 history > history.txt
|
||||
44 ls
|
||||
45 nano history.txt
|
||||
46 clear
|
||||
47 cat /proc/mdstat
|
||||
48 mdadm --add /dev/md0 /dev/sde1
|
||||
49 cat /proc/mdstat
|
||||
50 fdisk
|
||||
51 fdisk /dev/md0
|
||||
52 lsblk
|
||||
53 fdisk /dev/md0
|
||||
54 fdisk /dev/md0p1
|
||||
55 mkfs.ext4 /dev/md0p1
|
||||
56 mount help
|
||||
57 mount /dev/md0p1 /mnt
|
||||
58 df -h
|
||||
59 history > history2.txt
|
||||
60 nano history2.txt
|
||||
61 clear
|
||||
62 ls
|
||||
63 ../mnt/
|
||||
64 cd ../mnt/
|
||||
65 ls
|
||||
66 touch test
|
||||
67 cd
|
||||
68 clear
|
||||
69 dd if=/dev/zero of=/mnt/fic bs=1M count=50
|
||||
70 history > history3.txt
|
||||
71 mdadm /dev/md0 --fail /dev/sdb1
|
||||
72 cat /proc/mdstat
|
||||
73 history > lasthistory.txt
|
Loading…
x
Reference in New Issue
Block a user