renommé : TP04/Scripts/.bashrc -> sio1/TP04/Scripts/.bashrc renommé : TP04/Scripts/.lesshst -> sio1/TP04/Scripts/.lesshst renommé : TP04/Scripts/.profile -> sio1/TP04/Scripts/.profile renommé : TP04/Scripts/.ssh/id_rsa -> sio1/TP04/Scripts/.ssh/id_rsa renommé : TP04/Scripts/.ssh/id_rsa.pub -> sio1/TP04/Scripts/.ssh/id_rsa.pub renommé : TP04/Scripts/.ssh/known_hosts -> sio1/TP04/Scripts/.ssh/known_hosts renommé : TP04/Scripts/.ssh/known_hosts.old -> sio1/TP04/Scripts/.ssh/known_hosts.old renommé : TP04/Scripts/LeScript.sh -> sio1/TP04/Scripts/LeScript.sh renommé : TP04/Scripts/Users.csv -> sio1/TP04/Scripts/Users.csv renommé : TP04/Scripts/createLogins.sh -> sio1/TP04/Scripts/createLogins.sh renommé : TP04/Scripts/createUsers.sh -> sio1/TP04/Scripts/createUsers.sh renommé : TP04/Scripts/logins.csv -> sio1/TP04/Scripts/logins.csv renommé : TP04/Scripts/testlogin.csv -> sio1/TP04/Scripts/testlogin.csv renommé : siotp/sisr1/TP7/scriptsnft/current_ruleset.nft -> sio1/siotp/sisr1/TP7/scriptsnft/current_ruleset.nft renommé : siotp/sisr1/TP7/scriptsnft/fw_part1.nft -> sio1/siotp/sisr1/TP7/scriptsnft/fw_part1.nft renommé : siotp/sisr1/TP7/scriptsnft/fw_part2.nft -> sio1/siotp/sisr1/TP7/scriptsnft/fw_part2.nft renommé : siotp/sisr1/TP7/scriptsnft/fw_part3.nft -> sio1/siotp/sisr1/TP7/scriptsnft/fw_part3.nft renommé : siotp/sisr1/TP7/scriptsnft/fw_part4.nft -> sio1/siotp/sisr1/TP7/scriptsnft/fw_part4.nft renommé : siotp/sisr1/TP7/scriptsnft/fw_part5.nft -> sio1/siotp/sisr1/TP7/scriptsnft/fw_part5.nft renommé : siotp/sisr1/TP7/scriptsnft/fw_part6.nft -> sio1/siotp/sisr1/TP7/scriptsnft/fw_part6.nft renommé : siotp/sisr1/TP7/scriptsnft/fw_part7.nft -> sio1/siotp/sisr1/TP7/scriptsnft/fw_part7.nft renommé : siotp/sisr1/TP7/scriptsnft/old-current_ruleset.nft -> sio1/siotp/sisr1/TP7/scriptsnft/old-current_ruleset.nft renommé : siotp/sisr1/TP7/scriptsnft/refresh_firewall.sh -> sio1/siotp/sisr1/TP7/scriptsnft/refresh_firewall.sh renommé : siotp/sisr1/tp01-02/srv-dhcp/dhcpd.conf -> sio1/siotp/sisr1/tp01-02/srv-dhcp/dhcpd.conf renommé : siotp/sisr1/tp01-02/srv-dhcp/hosts -> sio1/siotp/sisr1/tp01-02/srv-dhcp/hosts renommé : siotp/sisr1/tp01-02/srv-dhcp/interfaces -> sio1/siotp/sisr1/tp01-02/srv-dhcp/interfaces renommé : siotp/sisr1/tp01-02/srv-dhcp/isc-dhcp-server -> sio1/siotp/sisr1/tp01-02/srv-dhcp/isc-dhcp-server renommé : siotp/sisr1/tp01-02/srv-dhcp/nat.sh -> sio1/siotp/sisr1/tp01-02/srv-dhcp/nat.sh renommé : siotp/sisr1/tp01-02/srv-dns1/db.sio1lab.lan -> sio1/siotp/sisr1/tp01-02/srv-dns1/db.sio1lab.lan renommé : siotp/sisr1/tp01-02/srv-dns1/db.sio1lab.lan.rev -> sio1/siotp/sisr1/tp01-02/srv-dns1/db.sio1lab.lan.rev renommé : siotp/sisr1/tp01-02/srv-dns1/named.conf -> sio1/siotp/sisr1/tp01-02/srv-dns1/named.conf renommé : siotp/sisr1/tp01-02/srv-dns1/named.conf.local -> sio1/siotp/sisr1/tp01-02/srv-dns1/named.conf.local renommé : siotp/sisr1/tp01-02/srv-dns1/named.conf.options -> sio1/siotp/sisr1/tp01-02/srv-dns1/named.conf.options renommé : siotp/sisr1/tp01-02/srv-dns2/db.sio1lab.lan -> sio1/siotp/sisr1/tp01-02/srv-dns2/db.sio1lab.lan renommé : siotp/sisr1/tp01-02/srv-dns2/db.sio1lab.lan.rev -> sio1/siotp/sisr1/tp01-02/srv-dns2/db.sio1lab.lan.rev renommé : siotp/sisr1/tp01-02/srv-dns2/named.conf.default-zones -> sio1/siotp/sisr1/tp01-02/srv-dns2/named.conf.default-zones renommé : siotp/sisr1/tp01-02/srv-dns2/named.conf.local -> sio1/siotp/sisr1/tp01-02/srv-dns2/named.conf.local renommé : siotp/sisr1/tp01-02/srv-dns2/named.conf.options -> sio1/siotp/sisr1/tp01-02/srv-dns2/named.conf.options renommé : siotp/sisr1/tp03/srv-admin/interfaces -> sio1/siotp/sisr1/tp03/srv-admin/interfaces renommé : siotp/sisr1/tp03/srv-admin/nat.sh -> sio1/siotp/sisr1/tp03/srv-admin/nat.sh renommé : siotp/sisr1/tp03/srv-dns2/bind/db.monlabo.lan -> sio1/siotp/sisr1/tp03/srv-dns2/bind/db.monlabo.lan renommé : siotp/sisr1/tp03/srv-dns2/bind/db.monlabo.lan.rev -> sio1/siotp/sisr1/tp03/srv-dns2/bind/db.monlabo.lan.rev renommé : siotp/sisr1/tp03/srv-dns2/bind/named.conf.local -> sio1/siotp/sisr1/tp03/srv-dns2/bind/named.conf.local renommé : siotp/sisr1/tp03/srv-dns2/bind/named.conf.options -> sio1/siotp/sisr1/tp03/srv-dns2/bind/named.conf.options renommé : siotp/sisr1/tp03/srv-service/bind/db.monlabo.lan -> sio1/siotp/sisr1/tp03/srv-service/bind/db.monlabo.lan renommé : siotp/sisr1/tp03/srv-service/bind/db.monlabo.lan.rev -> sio1/siotp/sisr1/tp03/srv-service/bind/db.monlabo.lan.rev renommé : siotp/sisr1/tp03/srv-service/bind/named.conf.local -> sio1/siotp/sisr1/tp03/srv-service/bind/named.conf.local renommé : siotp/sisr1/tp03/srv-service/bind/named.conf.options -> sio1/siotp/sisr1/tp03/srv-service/bind/named.conf.options renommé : siotp/sisr1/tp03/srv-service/dhcp/dhcpd.conf -> sio1/siotp/sisr1/tp03/srv-service/dhcp/dhcpd.conf renommé : siotp/sisr1/tp4/Users.csv -> sio1/siotp/sisr1/tp4/Users.csv renommé : siotp/sisr1/tp4/createLogins.sh -> sio1/siotp/sisr1/tp4/createLogins.sh renommé : siotp/sisr1/tp4/logins.csv -> sio1/siotp/sisr1/tp4/logins.csv renommé : squid/conf.d/debian.conf -> sio1/squid/conf.d/debian.conf renommé : squid/errorpage.css -> sio1/squid/errorpage.css renommé : squid/passwords -> sio1/squid/passwords renommé : squid/squid.conf -> sio1/squid/squid.conf renommé : squid/squid.conf.old -> sio1/squid/squid.conf.old renommé : squid/users -> sio1/squid/users
20 lines
439 B
Bash
20 lines
439 B
Bash
#!/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
|
|
|