Compare commits

...

26 Commits
tp01 ... main

Author SHA1 Message Date
Tom Guerin
816c3b2825 btsb 2025-04-02 16:04:44 +02:00
Tom Guerin
e258f4e440 ajout2liens 2025-03-26 17:08:33 +01:00
Tom Guerin
775fb1aea7 ajout2liens 2025-03-26 17:03:52 +01:00
Tom Guerin
4e6028da5f modiffichierconfigproxy 2025-03-26 16:24:23 +01:00
Tom Guerin
ac6e3d8c49 ajout 2025-03-26 15:55:57 +01:00
Tom Guerin
f40bec41c9 ajout script deploiement 2025-03-26 15:44:39 +01:00
Tom Guerin
38331c5ec7 ogb 2025-03-26 15:42:16 +01:00
7f146d222f uyhfuh 2025-03-26 15:40:22 +01:00
Tom Guerin
2bf1d5c883 gfmevmfiv 2025-03-24 09:41:33 +01:00
Tom Guerin
c620a6e399 gfmevmfiv 2025-03-24 09:37:37 +01:00
Tom Guerin
84affee441 cfidhe 2025-03-24 09:25:57 +01:00
b82a4e04cc new 2025-02-20 14:47:43 +01:00
05fd355c4f script 2025-02-19 17:54:12 +01:00
4178d7f03d test 2025-02-19 17:26:06 +01:00
32bd7a4d2f hfodi 2025-02-19 16:36:28 +01:00
cbd0cdf153 fichier 2025-02-19 16:15:38 +01:00
531f0740d9 scripts 2025-02-17 11:52:21 +01:00
75e6ff8184 Merge branch 'main' of https://gitea.lyc-lecastel.fr/tom.guerin/siotp 2025-02-17 10:52:46 +01:00
55f8032e8f fichiers 2025-02-17 09:38:41 +01:00
26629b2539 fichiers 2025-02-17 09:27:49 +01:00
74545ec1a4 script 2025-02-17 09:05:30 +01:00
342037638b tp3reseau 2025-02-13 14:51:29 +01:00
tom.guerin
75e6e843e5 dns2 2025-02-06 14:22:03 +01:00
122d238f62 dns1 2025-02-06 14:08:48 +01:00
tom.guerin
757151f41a dhcp 2025-02-06 13:40:30 +01:00
sio
6456fe3c15 dhcp 2025-02-06 13:37:55 +01:00
35 changed files with 9894 additions and 0 deletions

View File

@ -0,0 +1,35 @@
#!/bin/bash
# Affectation du nom d'utilisateur passé en paramètre à la variable "username"
username=$1
# extraction de la ligne correspondante du fichier de logs
user_line=$(grep $username ./logs_access.txt)
# Création d'une variable comprenant les groupes recherchés
groups=""
# Vérification de la présence du groupe sudo -> ajout de la fonction "administrateur" à $groups
if [[ $(echo $user_line | grep "sudo") != "" ]] ; then
groups=$groups" administrateur "
fi
# Vérification de la présence du groupe slam -> ajout de la fonction "développeur" à $groups
if [[ $(echo $user_line | grep "slam") != "" ]] ; then
groups=$groups" developpeur "
fi
# Vérification de la présence du groupe sisr -> ajout de la fonction "technicien" à $groups
if [[ $(echo $user_line | grep "sisr") != "" ]] ; then
groups=$groups" technicien "
fi # récupération du champ date + temps
date_time=$(echo $user_line | cut -d ":" -f4) #f4 -> 4eme champs
# récupération des champs dates (format US) et temps dans deux variables distinctes
date_us=$(echo $date_time | cut -d "_" -f1)
#[...]
date_heure=$(echo $date_time | cut -d "_" -f2)
# extraction de chaque information utile de ces champs
day=$(echo $date_us | cut -d "/" -f3)
month=$(echo $date_us | cut -d "/" -f2)
years=$(echo $date_us | cut -d "/" -f1)
hours=$(echo $date_heure | cut -d "-" -f1)
minutes=$(echo $date_heure | cut -d "-" -f2)
secondes=$(echo $date_heure | cut -d "-" -f3)
echo " L'utilisateur $username est membre de(s) groupe(s) $groups et sa dernière connexion remonte au $day/$month/$years à $hours h $minutes min et $secondes sec."

5
sisr1/QJ/logs_access.txt Normal file
View File

@ -0,0 +1,5 @@
admin:1000:users,sudo:24/10/07_21-41-28
jibril:1001:users,eleves_sio,slam:24/09/29_07-46-51
lea:1002:users,sudo,sisr:24/12/14_18-31-27
mona:1003:users,eleves_sio,sisr:24/10/05_15-30-23
luc:1004:users,eleves_sio,slam:24/10/02_12-14-50

5
sisr1/automatisation.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
files="./etc/crontab
0 2-3 * * * root scriptsauvegarde.sh

7
sisr1/gitpush.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
message=$1
git add .
git commit -m "$message"
git push -u https://tom.guerin@gitea.lyc-lecastel.fr/tom.guerin/siotp.git

5
sisr1/liste_a_copier Normal file
View File

@ -0,0 +1,5 @@
root@172.16.0.254:/etc/dhcp/dhcpd.conf
root@172.16.0.254:/etc/default/isc-dhcp-server
root@172.16.0.254:/etc/bind/named.conf.local
root@172.16.0.254:/etc/bind/db.monlabo.lan
root@172.16.0.254:/etc/bind/db.monlabo.lan.rev

16
sisr1/sciptsauvegarde.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
backup="/root/backupsvg"
mkdir $backup
while read line
do
scp $line $backup
done < liste_a_copier
tar -zcvf /root/svg.tar.gz $backup

View File

@ -0,0 +1,23 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet dhcp
#iface enp0s3 inet static
# address 192.168.0.24/24
# gateway 192.168.0.1
auto enp0s8
iface enp0s8 inet static
address 192.168.2.1/24
# gateway 192.168.0.1

View File

@ -0,0 +1,112 @@
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# option definitions common to all supported networks...
#option domain-name "sio-tg.lan";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 3600;
max-lease-time 7200;
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
#log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#subnet 10.152.187.0 netmask 255.255.255.0 {
#}
# This is a very basic subnet declaration.
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.10 192.168.2.110;
option routers 192.168.2.1;
option domain-name-servers 192.168.0.121;
option domain-name "sio-tg.lan";
}
host xp-2018{
hardware ethernet 08:00:27:77:70:0D;
fixed-address 192.168.2.111;
}
# This declaration allows BOOTP clients to get dynamic addresses,
#which we don't really recommend.
#subnet 10.254.239.32 netmask 255.255.255.224 {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
#host passacaglia {
# hardware ethernet 0:0:c0:5d:bd:95;
# filename "vmunix.passacaglia";
# server-name "toccata.example.com";
#}
# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
# hardware ethernet 08:00:07:26:c0:a5;
# fixed-address fantasia.example.com;
#}
# You can declare a class of clients and then do address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.
#class "foo" {
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}
#shared-network 224-29 {
# subnet 10.17.224.0 netmask 255.255.255.0 {
# option routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 {
# option routers rtr-29.example.org;
# }
# pool {
# allow members of "foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool {
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
#}

View File

@ -0,0 +1,23 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
#iface enp0s3 inet dhcp
iface enp0s3 inet static
address 192.168.0.120/24
gateway 192.168.0.1
auto enp0s8
iface enp0s8 inet static
address 192.168.2.1/24
# gateway 192.168.0.1

View File

@ -0,0 +1,19 @@
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA dns1-tg.sio-tg.lan. root.dns1-tg.sio-tg.lan. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
@ NS dns1-tg.sio-tg.lan.
dns2-tg.sio-tg.lan IN A 192.168.0.122
dns1-tg.sio-tg.lan. IN A 192.168.0.121
deb-dhcp-tg.sio-tg.lan. IN A 192.168.0.120
@ IN NS localhost.
@ IN A 127.0.0.1
@ IN A 192.168.0.120

View File

@ -0,0 +1,15 @@
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA dns-tg.sio-tg.lan. root.dns-tg.sio-tg.lan. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS dns1-tg.sio.lan.
120 IN PTR deb-dhcp-tg.sio-tg.lan.
121 IN PTR dns1-tg.sio-tg.lan.

View File

@ -0,0 +1,16 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
#iface enp0s3 inet dhcp
iface enp0s3 inet static
address 192.168.0.121/24
gateway 192.168.0.1

View File

@ -0,0 +1,12 @@
// zone directe
zone "sio-tg.lan" {
type master;
file "/etc/bind/db.sio-tg.lan";
};
// zone inverse
zone "0.168.192.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.sio-tg.lan.rev";
};

View File

@ -0,0 +1,4 @@
domain sio-tg.lan
search sio-tg.lan
nameserver 192.168.0.121
nameserver 10.121.38.8

View File

@ -0,0 +1,16 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
#iface enp0s3 inet dhcp
iface enp0s3 inet static
address 192.168.0.122/24
gateway 192.168.0.1

View File

@ -0,0 +1,15 @@
// zone directe
zone "sio-tg.lan" {
type slave;
file "/etc/bind/db.sio-tg.lan";
masters {192.168.0.121; };
masterfile-format text;
};
// zone inverse
zone "0.168.192.in-addr.arpa" {
type slave;
notify no;
file "/etc/bind/db.sio-tg.lan.rev";
masters { 192.168.0.121; };
};

View File

@ -0,0 +1,3 @@
domain sio-tg.lan
search sio-tg.lan
nameserver 127.0.0.1

View File

@ -0,0 +1,20 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
#iface enp0s3 inet dhcp
iface enp0s3 inet static
address 192.168.0.120/24
gateway 192.168.0.1
auto enp0s8
iface enp0s8 inet dhcp
# address 172.16.0.1/24

View File

@ -0,0 +1,16 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet dhcp
#iface enp0s3 inet static
# address 172.16.0.200/24
# gateway 172.16.0.1

View File

@ -0,0 +1,8 @@
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

View File

@ -0,0 +1,28 @@
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA srv-service.monlabo.lan. root.srv-service.monlabo.lan. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
NS srv-service.monlabo.lan.
srv-service A 172.16.0.254
srv-admin A 172.16.0.1
srvdns IN CNAME srv-service.monlabo.lan.
srvdns1 IN CNAME srv-service.monlabo.lan.
dns IN CNAME srv-service.monlabo.lan.
dns1 IN CNAME srv-service.monlabo.lan.
srvdhcp IN CNAME srv-service.monlabo.lan.
dhcp IN CNAME srv-service.monlabo.lan.
srvadmin IN CNAME srv-admin-tg.monlabo.lan.
router IN CNAME srv-admin-tg.monlabo.lan.
gateway IN CNAME srv-admin-tg.monlabo.lan.

View File

@ -0,0 +1,20 @@
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA srv-service.monlabo.lan. root.srv-service.monlabo.lan. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
@ IN NS srv-service.monlabo.lan.
@ IN A 127.0.0.1
srv-service A 172.16.0.254
254 PTR srv-service.moblabo.lan
1 PTR srv-admin-tg.monlabo.lan

View File

@ -0,0 +1,118 @@
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
#log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#subnet 10.152.187.0 netmask 255.255.255.0 {
#}
# This is a very basic subnet declaration.
subnet 172.16.0.0 netmask 255.255.255.0 {
range 172.16.0.100 172.16.0.200;
option routers 172.16.0.1;
option domain-name "monlabo.lan";
option domain-name-servers 172.16.0.254;
}
host srv-admin{
hardware ethernet 08:00:27:ef:99:fa;
fixed-address 172.16.0.1;
}
host srv-dns2{
hardware ethernet 08:00:27:4a:ed:f7;
fixed-address 172.16.0.254;
}
# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.
#subnet 10.254.239.32 netmask 255.255.255.224 {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
#host passacaglia {
# hardware ethernet 0:0:c0:5d:bd:95;
# filename "vmunix.passacaglia";
# server-name "toccata.example.com";
#}
# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
# hardware ethernet 08:00:07:26:c0:a5;
# fixed-address fantasia.example.com;
#}
# You can declare a class of clients and then do address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.
#class "foo" {
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}
#shared-network 224-29 {
# subnet 10.17.224.0 netmask 255.255.255.0 {
# option routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 {
# option routers rtr-29.example.org;
# }
# pool {
# allow members of "foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool {
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
#}

View File

@ -0,0 +1,16 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp0s3
#iface enp0s3 inet dhcp
iface enp0s3 inet static
address 172.16.0.254/24
gateway 172.16.0.1

View File

@ -0,0 +1,11 @@
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

View File

@ -0,0 +1,19 @@
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
// zone directe
zone "monlabo.lan" {
type master;
file "/etc/bind/db.monlabo.lan";
};
// zone inverse
zone "0.16.172.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.monlabo.lan.rev";
};

View File

@ -0,0 +1,30 @@
Ermengarde,Berthelmot,eberthelmot0@webmd.com,Female,Accountant,
Kassi,Bunker,kbunker1@xinhuanet.com,Female,Production,
Moises,McCallum,mmccallum2@i2i.jp,Male,Production,
Patrizio,Lune,plune3@upenn.edu,Male,Accountant,
Blanch,Everix,beverix4@php.net,Female,Accountant,
Stafani,Kibbel,skibbel5@marriott.com,Female,Production,
Ignacius,Mosdell,imosdell6@cloudflare.com,Male,Management,
Jeana,Waller-Bridge,jwallerbridge7@mapy.cz,Female,Management,
Elroy,Dressel,edressel8@opera.com,Male,Production,
Thea,Strettell,tstrettell9@nature.com,Female,Production,
Solomon,Insoll,sinsolla@utexas.edu,Male,Accountant,
Carri,Feedome,cfeedomeb@ask.com,Female,Accountant,
Padraic,Chetwind,pchetwindc@last.fm,Male,Management,
Solly,D'Ugo,sdugod@uiuc.edu,Male,Production,
Konstanze,MacCostigan,kmaccostigane@seattletimes.com,Female,Accountant,
Roxane,Powlesland,rpowleslandf@pcworld.com,Female,Management,
Orelle,Kennealy,okennealyg@arstechnica.com,Female,Production,
Sukey,Soitoux,ssoitouxh@shinystat.com,Female,Production,
Nelli,Syce,nsycei@blogger.com,Female,Production,
Clarisse,Shillam,cshillamj@dailymotion.com,Female,Production,
Carin,Gueny,cguenyk@naver.com,Female,Management,
Donny,Riepel,driepell@addtoany.com,Male,Production,
Daniella,Ralfe,dralfem@wunderground.com,Female,Production,
Lexy,Clynmans,lclynmansn@furl.net,Female,Production,
Gardiner,Adamthwaite,gadamthwaiteo@spotify.com,Male,Production,
Woodman,Lippett,wlippettp@purevolume.com,Male,Production,
Nadya,Munnion,nmunnionq@flavors.me,Female,Production,
Llewellyn,Habershon,lhabershonr@alibaba.com,Male,Production,
Isaak,Greatrex,igreatrexs@seesaa.net,Male,Production,
Darill,Frostdyke,dfrostdyket@cafepress.com,Male,Production,
1 Ermengarde Berthelmot eberthelmot0@webmd.com Female Accountant
2 Kassi Bunker kbunker1@xinhuanet.com Female Production
3 Moises McCallum mmccallum2@i2i.jp Male Production
4 Patrizio Lune plune3@upenn.edu Male Accountant
5 Blanch Everix beverix4@php.net Female Accountant
6 Stafani Kibbel skibbel5@marriott.com Female Production
7 Ignacius Mosdell imosdell6@cloudflare.com Male Management
8 Jeana Waller-Bridge jwallerbridge7@mapy.cz Female Management
9 Elroy Dressel edressel8@opera.com Male Production
10 Thea Strettell tstrettell9@nature.com Female Production
11 Solomon Insoll sinsolla@utexas.edu Male Accountant
12 Carri Feedome cfeedomeb@ask.com Female Accountant
13 Padraic Chetwind pchetwindc@last.fm Male Management
14 Solly D'Ugo sdugod@uiuc.edu Male Production
15 Konstanze MacCostigan kmaccostigane@seattletimes.com Female Accountant
16 Roxane Powlesland rpowleslandf@pcworld.com Female Management
17 Orelle Kennealy okennealyg@arstechnica.com Female Production
18 Sukey Soitoux ssoitouxh@shinystat.com Female Production
19 Nelli Syce nsycei@blogger.com Female Production
20 Clarisse Shillam cshillamj@dailymotion.com Female Production
21 Carin Gueny cguenyk@naver.com Female Management
22 Donny Riepel driepell@addtoany.com Male Production
23 Daniella Ralfe dralfem@wunderground.com Female Production
24 Lexy Clynmans lclynmansn@furl.net Female Production
25 Gardiner Adamthwaite gadamthwaiteo@spotify.com Male Production
26 Woodman Lippett wlippettp@purevolume.com Male Production
27 Nadya Munnion nmunnionq@flavors.me Female Production
28 Llewellyn Habershon lhabershonr@alibaba.com Male Production
29 Isaak Greatrex igreatrexs@seesaa.net Male Production
30 Darill Frostdyke dfrostdyket@cafepress.com Male Production

View File

@ -0,0 +1,15 @@
#!/bin/bash
fichier=./Users.csv #Variable fichier qui stock le chemin du fichier
while read ligne #définit la variable "ligne" comme le contenu de la ligne du fichier en cours de lecture
do
#a chaque iteration on rentre dans la variable metier on isole le champ 5 de la ligne.
metier=$(echo $ligne | cut -d "," -f5)
if [[ $(grep $metier /etc/group) == "" ]] ; then
groupadd $metier
fi
#on cherche metier dans le repertoire des groupe
#grep $metier /etc/group
#on rentre les données du fichier avec done <
done < $fichier

View File

@ -0,0 +1,21 @@
#!/bin/bash
fichier_a_lire=./Users.csv #creation fichier a lire
fichier_a_ecrire=./logins.csv #creation fichier a lire + stockage dans cette variable
rm $fichier_a_ecrire 2> /dev/null #supprimer le fichier avant d'executer le script. / redirection des erreurs
touch $fichier_a_ecrire #creer le fichier a l'execution le script
while read line
do
aecrire=""
last_name=$(echo $line | cut -d "," -f2)
first_name=$(echo $line | cut -d "," -f1)
login=$(echo $first_name | cut -c1)$last_name
login=$(echo $login | tr [:upper:] [:lower:])
login=$(echo $login | tr -dc [:alnum:])
password=$(tr -dc '12345!@#$%^&*()_A-Z-a-z-0-9'</dev/urandom| head -c8)
group=$(echo $line | cut -d "," -f5)
aecrire="$login;$password;$first_name;$last_name;$group"
echo $aecrire >> $fichier_a_ecrire
done < $fichier_a_lire

View File

@ -0,0 +1,18 @@
#!/bin/bash
fichier_a_lire=./logins.csv
while read line
do
user=$(echo $line | cut -d ";" -f1)
useradd -m -s "/bin/bash" $user
group=$(echo $line | cut -d ";" -f5)
usermod -aG $group $user
passwd=$(echo $line | cut -d ";" -f2)
echo $user:$passwd | chpasswd
chown $user:$user /home/$user
done < $fichier_a_lire

View File

@ -0,0 +1,18 @@
#!/bin/bash
ip=$1
chemin=/root/deploy
user=root
ssh $user@$ip "mkdir $chemin" 2> /dev/null
scp createGroups.sh $user@$ip:$chemin
scp createUsers.sh $user@$ip:$chemin
scp logins.csv $user@$ip:$chemin
scp Users.csv $user@$ip:$chemin
ssh $user@$ip "cd $chemin ; bash createGroups.sh ; bash createUsers.sh"
ssh $user@$ip "rm -R $chemin"

View File

@ -0,0 +1,30 @@
eberthelmot;esBc1I^F;Ermengarde;Berthelmot;Accountant
kbunker;-barRdEy;Kassi;Bunker;Production
mmccallum;*HTbYCAK;Moises;McCallum;Production
plune;%bWyo_Sb;Patrizio;Lune;Accountant
beverix;waorB$Pf;Blanch;Everix;Accountant
skibbel;09JS7NTQ;Stafani;Kibbel;Production
imosdell;ZM9J^G(n;Ignacius;Mosdell;Management
jwallerbridge;q#SwzKZd;Jeana;Waller-Bridge;Management
edressel;PKLYzT6p;Elroy;Dressel;Production
tstrettell;x7D6zjD#;Thea;Strettell;Production
sinsoll;9zu5856m;Solomon;Insoll;Accountant
cfeedome;F@CQrTak;Carri;Feedome;Accountant
pchetwind;I%xQIWVK;Padraic;Chetwind;Management
sdugo;uRFMtM0K;Solly;D'Ugo;Production
kmaccostigan;4w5J7r(n;Konstanze;MacCostigan;Accountant
rpowlesland;(vzM5irO;Roxane;Powlesland;Management
okennealy;iMM$W0A@;Orelle;Kennealy;Production
ssoitoux;6NX^zZPy;Sukey;Soitoux;Production
nsyce;5f__@IKV;Nelli;Syce;Production
cshillam;ZK4pq!yg;Clarisse;Shillam;Production
cgueny;P#*e0UNs;Carin;Gueny;Management
driepel;sjECnfF);Donny;Riepel;Production
dralfe;cb4icl_6;Daniella;Ralfe;Production
lclynmans;WmITS!v6;Lexy;Clynmans;Production
gadamthwaite;CK!Fn1!!;Gardiner;Adamthwaite;Production
wlippett;HBRh6%MR;Woodman;Lippett;Production
nmunnion;4(LzplYR;Nadya;Munnion;Production
lhabershon;puQ#bc1X;Llewellyn;Habershon;Production
igreatrex;ij*LJVZh;Isaak;Greatrex;Production
dfrostdyke;fxm&GVn5;Darill;Frostdyke;Production
1 eberthelmot esBc1I^F Ermengarde Berthelmot Accountant
2 kbunker -barRdEy Kassi Bunker Production
3 mmccallum *HTbYCAK Moises McCallum Production
4 plune %bWyo_Sb Patrizio Lune Accountant
5 beverix waorB$Pf Blanch Everix Accountant
6 skibbel 09JS7NTQ Stafani Kibbel Production
7 imosdell ZM9J^G(n Ignacius Mosdell Management
8 jwallerbridge q#SwzKZd Jeana Waller-Bridge Management
9 edressel PKLYzT6p Elroy Dressel Production
10 tstrettell x7D6zjD# Thea Strettell Production
11 sinsoll 9zu5856m Solomon Insoll Accountant
12 cfeedome F@CQrTak Carri Feedome Accountant
13 pchetwind I%xQIWVK Padraic Chetwind Management
14 sdugo uRFMtM0K Solly D'Ugo Production
15 kmaccostigan 4w5J7r(n Konstanze MacCostigan Accountant
16 rpowlesland (vzM5irO Roxane Powlesland Management
17 okennealy iMM$W0A@ Orelle Kennealy Production
18 ssoitoux 6NX^zZPy Sukey Soitoux Production
19 nsyce 5f__@IKV Nelli Syce Production
20 cshillam ZK4pq!yg Clarisse Shillam Production
21 cgueny P#*e0UNs Carin Gueny Management
22 driepel sjECnfF) Donny Riepel Production
23 dralfe cb4icl_6 Daniella Ralfe Production
24 lclynmans WmITS!v6 Lexy Clynmans Production
25 gadamthwaite CK!Fn1!! Gardiner Adamthwaite Production
26 wlippett HBRh6%MR Woodman Lippett Production
27 nmunnion 4(LzplYR Nadya Munnion Production
28 lhabershon puQ#bc1X Llewellyn Habershon Production
29 igreatrex ij*LJVZh Isaak Greatrex Production
30 dfrostdyke fxm&GVn5 Darill Frostdyke Production

View File

@ -0,0 +1,14 @@
#!/bin/bash
filename=squid.conf #nom du fichier à récuperer
filepath=/etc/squid #chemin
servicename=squid.service #nom du service
git pull #mise a jour du depot distant
sudo cp $filepath/$filename $filepath/$filename.old #sauvegarde en changeant le nom .old
sudo cp ./$filename $filepath/$filename
sudo systemctl restart $servicename #restart le service

9161
sisr1/tp05_squid/squid.conf Normal file

File diff suppressed because it is too large Load Diff