From 4d789def5c4d1d403489c3cc05b91283095e8aaa Mon Sep 17 00:00:00 2001 From: root Date: Mon, 4 Mar 2024 11:03:37 +0100 Subject: [PATCH] =?UTF-8?q?=09nouveau=20fichier=C2=A0:=20TP04/Scripts/LeSc?= =?UTF-8?q?ript.sh=20=09nouveau=20fichier=C2=A0:=20TP04/Scripts/Users.csv?= =?UTF-8?q?=20=09nouveau=20fichier=C2=A0:=20TP04/Scripts/createLogins.sh?= =?UTF-8?q?=20=09nouveau=20fichier=C2=A0:=20TP04/Scripts/createUsers.sh=20?= =?UTF-8?q?=09nouveau=20fichier=C2=A0:=20TP04/Scripts/logins.csv=20=09nouv?= =?UTF-8?q?eau=20fichier=C2=A0:=20TP04/Scripts/testlogin.csv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TP04/Scripts/.bash_history | 319 ++++++++++++++++++++++++++++++ TP04/Scripts/.bashrc | 18 ++ TP04/Scripts/.lesshst | 1 + TP04/Scripts/.profile | 9 + TP04/Scripts/.ssh/id_rsa | 39 ++++ TP04/Scripts/.ssh/id_rsa.pub | 1 + TP04/Scripts/.ssh/known_hosts | 6 + TP04/Scripts/.ssh/known_hosts.old | 4 + TP04/Scripts/LeScript.sh | 8 + TP04/Scripts/Users.csv | 30 +++ TP04/Scripts/createLogins.sh | 17 ++ TP04/Scripts/createUsers.sh | 19 ++ TP04/Scripts/logins.csv | 30 +++ TP04/Scripts/testlogin.csv | 3 + 14 files changed, 504 insertions(+) create mode 100644 TP04/Scripts/.bash_history create mode 100644 TP04/Scripts/.bashrc create mode 100644 TP04/Scripts/.lesshst create mode 100644 TP04/Scripts/.profile create mode 100644 TP04/Scripts/.ssh/id_rsa create mode 100644 TP04/Scripts/.ssh/id_rsa.pub create mode 100644 TP04/Scripts/.ssh/known_hosts create mode 100644 TP04/Scripts/.ssh/known_hosts.old create mode 100644 TP04/Scripts/LeScript.sh create mode 100644 TP04/Scripts/Users.csv create mode 100644 TP04/Scripts/createLogins.sh create mode 100644 TP04/Scripts/createUsers.sh create mode 100644 TP04/Scripts/logins.csv create mode 100644 TP04/Scripts/testlogin.csv diff --git a/TP04/Scripts/.bash_history b/TP04/Scripts/.bash_history new file mode 100644 index 0000000..837481c --- /dev/null +++ b/TP04/Scripts/.bash_history @@ -0,0 +1,319 @@ +sudo apt-get install sudo mc tcpdump + apt-get install sudo mc tcpdump +sudo cd +host dns +exit +nano /etc/ssh/sshd_config +ip a +systemctl restart ssh +nano /etc/ssh/sshd_config +ip r +nano /etc/network/interfaces +ssh-keygen +ip a* +ip a +host dns +host google.com +host dns +cat /etc/resolv.conf +dhclient +cat /etc/resolv.conf +dhclient +reboot +ip a +cat /etc/resolv.conf +host dns +ping 172.16.0.1 +host srv-service +nano /etc/resolv.conf +host srv-service +host google.com +host 172.16.0.254 +host 172.16.0.254 +logout +ip a +ifdown enp0s3 +ifup enp0s3 +ip a +nano /etc/resolv.conf +host google.com +ip a +nano /etc/network/interfaces +nano /etc/network/interfaces +nano /etc/network/interfaces +i^p a +ip a +touch createLogins.sh +bash createLogins.sh +nano createLogins.sh +nano createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +nano createLogins.sh +nano createLogins.sh +nano createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +ls +cat logins.csv +bash createLogins.sh +cat logins.csv +nano createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +bash createLogins.sh +nano createLogins.sh +ip a +bash createLogins.sh +ls +ls +ls -r +ls -l +ls -f +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +ls /home/sio/ +ls +ls -f +ip a +ls +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +ls +ls- l +ls- r +ls -l +ls +clear +nano createLogins.sh +scp ~/Téléchargements/Users.csv root@192.168.0.30 +scp /Téléchargements/Users.csv root@192.168.0.30 +scp ~/Téléchargements/Users.csv root@192.168.0.30:etc/ +ls +ls /etc/ +cp /etc/Users.csv ./ +ls +bash createLogins.sh +nano createLogins.sh +bash createLogins.sh +nano createLogins.sh +ls +cat logins.csv +nano createLogins.sh +touch createUsers.sh +nano createUsers.sh +nano createLogins.sh +nano createUsers.sh +cat logins.csv +clear +nano createUsers.sh +touch testlogin.csv +nano testlogin.csv +nano logins.csv +nano testlogin.csv +nano logins.csv +nano testlogin.csv +nano logins.csv +nano testlogin.csv +nano createUsers.sh +nano /etc/group +nano createUsers.sh +getent group +nano createUsers.sh +bash createUsers.sh +nano createUsers.sh +nano testlogin.csv +nano createUsers.sh +bash createUsers.sh tcpdump +nano createUsers.sh +nano createUsers.sh +bash createUsers.sh 1ertest +nano createUsers.sh +bash createUsers.sh tcpdump +nano createUsers.sh +man grep +nano createUsers.sh +bash createUsers.sh tcpdump +nano createUsers.sh +bash createUsers.sh tcpdump +nano createUsers.sh +bash createUsers.sh tcpdump +nano createUsers.sh +bash createUsers.sh tcpdump +bash createUsers.sh gre1 +bash createUsers.sh gre1 +nano createUsers.sh +bash createLogins.sh +nano createLogins.sh +nano createUsers.sh +ls +nano createUsers.sh +nano createUsers.sh b +nano createUsers.sh +nano createUsers.sh +bash createUsers.sh +bash createUsers.sh +bash createUsers.sh +bash createUsers.sh +bash createUsers.sh +bash createUsers.sh +bash createUsers.sh +nano /etc/group +nano testlogin.csv +cat temptp4.txt +cat temptp4.txt +cat temptp4.txt +cat temptp4.txt +nano createUsers.sh +nano createUsers.sh +nano createUsers.sh +nano /etc/group +nano createUsers.sh +nano createUsers.sh +nano createUsers.sh +nano createUsers.sh +nano createUsers.sh +nano createUsers.sh +bash createUsers.sh +nano createUsers.sh +nano createUsers.sh +nano createUsers.sh +nano createUsers.sh +bash createUsers.sh +bash createUsers.sh +nano createUsers.sh +bash createUsers.sh +nano createUsers.sh +bash createUsers.sh +getent Users +cd /etc +ls +cat passwd +cat /users +cat /group +cat group +man usermod +useradd anthonycon --gropups +useradd anthonycon --groups +useradd anthonycon --groups +useradd anthonycon --groups +useradd anthonycon --groups +useradd anthonycon --groups +useradd anthonycon --groups sio +cat group +cd +nano createUsers.sh +nano createUsers.sh +nano createUsers.sh +nano createUsers.sh +bash createUsers.sh +nano createUsers.sh +nano createUsers.sh +bash createUsers.sh +nano createUsers.sh +bash createUsers.sh +bash createUsers.sh +nano testlogin.csv +bash createUsers.sh +nano testlogin.csv +nano createUsers.sh +bash createUsers.sh +ls /home +ls -l +ls -l /home +nano createUsers.sh +nano createUsers.sh +bash createUsers.sh +bash createUsers.sh +nano createUsers.sh +ip a +nano create +nano createUsers.sh +nano logins.csv +nano testlogin.csv +nano createUsers.sh +bash createUsers.sh +logout +nano createUsers.sh +logout +ls -l /home +nano createUsers.sh +touch LeScript +mv LeScript LeScript.sh +nano LeScript.sh +nano LeScript.sh +nano LeScript.sh +bash LeScript.sh +nano LeScript.sh +nano createUsers.sh +nano LeScript.sh +nano LeScript.sh +bash LeScript.sh +nano LeScript.sh +bash LeScript.sh +nano LeScript.sh +nano createUsers.sh +nano LeScript.sh +ls +logout +ip a +nano LeScript.sh +ls +nano LeScript.sh +nano LeScript.sh +nano createUsers.sh +man groupa +nano LeScript.sh +nano LeScript.sh +ls +nano LeScript.sh +nano LeScript.sh +bash LeScript.sh +nano LeScript.sh +bash LeScript.sh +ls +nano LeScript.sh +bash LeScript.sh +nano LeScript.sh +bash LeScript.sh +bash createLogins.sh +nano createLogins.sh + +nano LeScript.sh diff --git a/TP04/Scripts/.bashrc b/TP04/Scripts/.bashrc new file mode 100644 index 0000000..df9ee74 --- /dev/null +++ b/TP04/Scripts/.bashrc @@ -0,0 +1,18 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. + +# Note: PS1 and umask are already set in /etc/profile. You should not +# need this unless you want different defaults for root. +# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ ' +# umask 022 + +# You may uncomment the following lines if you want `ls' to be colorized: +# export LS_OPTIONS='--color=auto' +# eval "$(dircolors)" +# alias ls='ls $LS_OPTIONS' +# alias ll='ls $LS_OPTIONS -l' +# alias l='ls $LS_OPTIONS -lA' +# +# Some more alias to avoid making mistakes: +# alias rm='rm -i' +# alias cp='cp -i' +# alias mv='mv -i' diff --git a/TP04/Scripts/.lesshst b/TP04/Scripts/.lesshst new file mode 100644 index 0000000..4d1c30b --- /dev/null +++ b/TP04/Scripts/.lesshst @@ -0,0 +1 @@ +.less-history-file: diff --git a/TP04/Scripts/.profile b/TP04/Scripts/.profile new file mode 100644 index 0000000..c4c7402 --- /dev/null +++ b/TP04/Scripts/.profile @@ -0,0 +1,9 @@ +# ~/.profile: executed by Bourne-compatible login shells. + +if [ "$BASH" ]; then + if [ -f ~/.bashrc ]; then + . ~/.bashrc + fi +fi + +mesg n 2> /dev/null || true diff --git a/TP04/Scripts/.ssh/id_rsa b/TP04/Scripts/.ssh/id_rsa new file mode 100644 index 0000000..112a6e0 --- /dev/null +++ b/TP04/Scripts/.ssh/id_rsa @@ -0,0 +1,39 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABDN5LV/DY +sSGO0EoTx088Q3AAAAEAAAAAEAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQC0imYJ5Oqm +SXlpzBSKm8dSF+vgWAdn8FIdzCO+wT2Vb+dSUaUwXm3KTbW+a/S9KGz6Vjd63pHZfkydS1 +EP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85GZQpwuszmp5m7omCoTMvNWSvbimbCy6 +VYRgUu8f99n8ta5NhFQeRlkJCaIntie0oUv2xMBzsOTmfEyAUwocRZJmyctYMn+uJUchmb +d7IrzFW7JWvPAiBAfHc4E8kZlcU2m9FanWyibe49yyeQrDxseJhdwr0QIXf4NPG1OAfFCy +qcSr13KeeidVOB5FyLeFb3r+Tr8= +-----END OPENSSH PRIVATE KEY----- diff --git a/TP04/Scripts/.ssh/id_rsa.pub b/TP04/Scripts/.ssh/id_rsa.pub new file mode 100644 index 0000000..a26ca51 --- /dev/null +++ b/TP04/Scripts/.ssh/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC0imYJ5OqmSXlpzBSKm8dSF+vgWAdn8FIdzCO+wT2Vb+dSUaUwXm3KTbW+a/S9KGz6Vjd63pHZfkydS1EPGnp1U/jOdDuNXAOT/7TCoGcrDyEdAMUmxFA/cUMEDvpgpoEicsJZy03BCTcG1jCa5q7aMXpKDmSJoOg6DcS1emsYmli74x4PANOcN19cn69QHviLCxIFI+sanQUSXZwYRsYYcczRh0AAo3iIMzVDDZJ979wnpojdDRLtChxrnmGNSeIiHf0HZSft95cwjH8+YmyPuBg5k+olndYeQX9qAQDmP24yHOXBcxyRdvCN9o4o3Lg6XpzUV/1uU5eXegZc7fLKVPlnj7vGCp/8PzUMXY7VvVxF9ZRtzL8xBkCV5EaoDC7lESdSPKWrRyo8hMYfY/gb5dfJ8LGl9MxrV7B6Y36r+Gy7NgiiRQQbO6734wd/8ebrRP+1y8026NdFzIyL3R5j0Bj5jf8IZVL45UUPdmtd9SsZjgvkazVUNZSPwbtgjzc= root@debtest diff --git a/TP04/Scripts/.ssh/known_hosts b/TP04/Scripts/.ssh/known_hosts new file mode 100644 index 0000000..70c82c4 --- /dev/null +++ b/TP04/Scripts/.ssh/known_hosts @@ -0,0 +1,6 @@ +|1|VlH4rpkRpKXcwc5jujSyukPNPIo=|NodfXAiTzrYqYprzY6n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9iS2rBa8RlzQ4=|wi4qS71HNRkCWfSVnBl3NWF4GBs= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCkLJJW8/CVfG2dGOJ6eEPvhizumun+bdOYVkons7YXW3ixwhunzb4G12clElTeTBFauv3wss3XOJqWnz4hb4f+UoHnhqTje2TryrldWATb1b2EuOUXi4/9wudrf+HZ90knc5zzp2c46yzqTil/rPW5npT+DfWeO6B1wS2jGGcwt67+aQ8gIyi/KdngscjNzg118usnpAh9cjh7eLovJ+wVNVMypKQw23PQKTfeXPsuhpfZtOmEg88sy1xbB44EzUygVGOeH+MLUATVHQzxNqU+oiEyn38TWi7czE97oDyMj1Kcso7Qm/1iFyYWFBiklmXgciqkAiQVImWID9vKecFWwbLoNjDr/OYnYQhUQgVyu1WkXxm753+y29oPqE6rcgwpglIgV6qDPNwkCBuGFIByRMwEuIRCPm6nn0kLj27jzr2s25OLK0BGtreGlJwpG5pP4/lNmCcaN0mqAIuPs8g3kTl3wYIQH4fKTrISi9CdTFRq34ftjEG/BlHBeEsKQS0= +|1|US0isKOaYLfNV4urjajTCxhsTGM=|JG5zbJTADQ+FG+SpDgaxlk4dpbA= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKIehIUy61f8lSczNdHFQ92bVZpiGwB3FrOrD2tm5PLi6SWxlA6IiTlRZK1sjxvVV6fJqWlryC0iplvggJE+qoc= diff --git a/TP04/Scripts/.ssh/known_hosts.old b/TP04/Scripts/.ssh/known_hosts.old new file mode 100644 index 0000000..10108ef --- /dev/null +++ b/TP04/Scripts/.ssh/known_hosts.old @@ -0,0 +1,4 @@ +|1|VlH4rpkRpKXcwc5jujSyukPNPIo=|NodfXAiTzrYqYprzY6nswhXqtkg= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFCmDQVUioLfMp2EfFYoZWk08cTzxz57f9wotJNyrEe +|1|4TzpEIZ54PspUVcKvQhybYxWGlA=|q1Y527vq5eXoA5SCrrGuc0DVavk= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDcu1MvOXx5nN39xuBCyEasaAyAZS/URtbkdLD2+XD8ngwv4J++4A9yAbPzbh0uE+Lp9KygedIR6hJksLl6b2EfUUmtCDIswdiadSkh6QqM05f5mfV+MjB9+4HWXonjebrMtYFeEOLpgqG+YtRFs6cVzXiUMQ2q3jbE+I+ivxRfzdiFGaMZ5PFnDRKHSqg0HmBCyQ3ytWlBuYZj4/k2o7mjitZz2Eqq1Jhie/y2aqTPX9CfEPWy06QcCImOurkQWkvHiLiDZqU+5guj3u3ne5p2nZu3qjZoROBwxzkeuGbI5zTjIDcqA9jqNG4QzWqKxkKohqWUXjcJus2kxDk2R1UceElBQ/qmZWiMkEj5N6S3UJ7s278VRx42riAo8oTfojQwHNkcArQ0qeo9bnQXgqzuu0HrmDzEz47juQrUnLf5W4a6y75+knOsZVwI5Z1OGhdsvBzDNRgZ5Jz4Li3yZQgfRTODgZecLZt2Mw1WyTW+Et99I4+NI21yq0XdYYIus7c= +|1|PPdVJ6gCrKfevKGNtBMzmQpHMmw=|CMNFJ7HJsDqTt1EdTpIw0IW/UGA= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDMsEaO28xNEWNh4zHy1BN3ZEbwsa1VysH+agH79NmTdWqm67BR6R6+Rqc5oWJaNFKDpJROU/6ncOoVM3Qk7MGU= +|1|bcNjCJb/OpmfhuYIa9YCIFtN/P4=|DVHRinAYdbdDUIdDuRLFbmFvrwA= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIObY4qQyaHJA5+Cvml7YgJvxe/w+A49n0BTnedm7YQ95 diff --git a/TP04/Scripts/LeScript.sh b/TP04/Scripts/LeScript.sh new file mode 100644 index 0000000..5113b9d --- /dev/null +++ b/TP04/Scripts/LeScript.sh @@ -0,0 +1,8 @@ +#!/bin/bash +echo "Entrer l'adresse IP !" +read address +scp ./createUsers.sh root@$address:/root +scp ./logins.csv root@$address:/root +ssh root@$address "bash /root/createUsers.sh" +ssh root@$address "rm /root/createUsers.sh" +ssh root@$address "rm /root/logins.csv" diff --git a/TP04/Scripts/Users.csv b/TP04/Scripts/Users.csv new file mode 100644 index 0000000..9dfb324 --- /dev/null +++ b/TP04/Scripts/Users.csv @@ -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, diff --git a/TP04/Scripts/createLogins.sh b/TP04/Scripts/createLogins.sh new file mode 100644 index 0000000..eaa3465 --- /dev/null +++ b/TP04/Scripts/createLogins.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +rm ./logins.csv +while read line +do +touch ./temp.txt +echo $line > ./temp.txt +prenom=$(cut -d "," -f 1 ./temp.txt) +nom=$(cut -d "," -f 2 ./temp.txt) +initial=$(cut -c 1 ./temp.txt) +id=$(echo $initial$nom | tr [:upper:] [:lower:]) +passwd=$(echo $RANDOM | md5sum | head -c 8) + +echo $id","$passwd","$prenom","$nom","$(cut -d "," -f 5 ./temp.txt)"," >> ./logins.csv + +rm ./temp.txt +done < ./Users.csv diff --git a/TP04/Scripts/createUsers.sh b/TP04/Scripts/createUsers.sh new file mode 100644 index 0000000..4d458ef --- /dev/null +++ b/TP04/Scripts/createUsers.sh @@ -0,0 +1,19 @@ +#!/bin/bash +while read line +do + touch ./temptp4.txt + echo $line > ./temptp4.txt + group=$(cut -d "," -f 5 ./temptp4.txt) + user=$(cut -d "," -f 1 ./temptp4.txt) + mdp=$(cut -d "," -f 2 ./temptp4.txt) + if grep -q $group /etc/group ; then + echo "ok" + else + echo "existe pas ; création" + groupadd -f $group + fi + useradd $user --create-home --groups $group --shell /bin/bash + echo "$user:$mdp" | chpasswd + rm ./temptp4.txt +done < logins.csv + diff --git a/TP04/Scripts/logins.csv b/TP04/Scripts/logins.csv new file mode 100644 index 0000000..71dbae6 --- /dev/null +++ b/TP04/Scripts/logins.csv @@ -0,0 +1,30 @@ +eberthelmot,26531516,Ermengarde,Berthelmot,Accountant, +kbunker,900e4e1b,Kassi,Bunker,Production, +mmccallum,91aa2192,Moises,McCallum,Production, +plune,bf26a431,Patrizio,Lune,Accountant, +beverix,1ecbd424,Blanch,Everix,Accountant, +skibbel,63e581d2,Stafani,Kibbel,Production, +imosdell,e247d728,Ignacius,Mosdell,Management, +jwaller-bridge,ea178a13,Jeana,Waller-Bridge,Management, +edressel,72001e83,Elroy,Dressel,Production, +tstrettell,7600fc16,Thea,Strettell,Production, +sinsoll,01b303e4,Solomon,Insoll,Accountant, +cfeedome,66e6ab97,Carri,Feedome,Accountant, +pchetwind,e4200d0c,Padraic,Chetwind,Management, +sd'ugo,b3e00991,Solly,D'Ugo,Production, +kmaccostigan,4185bf2f,Konstanze,MacCostigan,Accountant, +rpowlesland,45e48289,Roxane,Powlesland,Management, +okennealy,a354f4b4,Orelle,Kennealy,Production, +ssoitoux,065022fc,Sukey,Soitoux,Production, +nsyce,440a9fe0,Nelli,Syce,Production, +cshillam,a60ba40e,Clarisse,Shillam,Production, +cgueny,cc07a74d,Carin,Gueny,Management, +driepel,c8e6358d,Donny,Riepel,Production, +dralfe,94a56564,Daniella,Ralfe,Production, +lclynmans,5fa49cab,Lexy,Clynmans,Production, +gadamthwaite,c553a95c,Gardiner,Adamthwaite,Production, +wlippett,c4d7d26f,Woodman,Lippett,Production, +nmunnion,ae8d3333,Nadya,Munnion,Production, +lhabershon,c24f8825,Llewellyn,Habershon,Production, +igreatrex,516350fa,Isaak,Greatrex,Production, +dfrostdyke,1e293f6b,Darill,Frostdyke,Production, diff --git a/TP04/Scripts/testlogin.csv b/TP04/Scripts/testlogin.csv new file mode 100644 index 0000000..ed0535d --- /dev/null +++ b/TP04/Scripts/testlogin.csv @@ -0,0 +1,3 @@ +test1,1,prénom1,nom1,grp1 +test2,2,prénom2,nom2,grp1 +test3,3,prénom3,nom3,grp2