diff --git a/sisr1/tp04_scripts_admin/createUsers.sh b/sisr1/tp04_scripts_admin/createUsers.sh new file mode 100644 index 0000000..7d7d59c --- /dev/null +++ b/sisr1/tp04_scripts_admin/createUsers.sh @@ -0,0 +1,14 @@ +#!/bin/bash +fichier=./logins.csv #le fichier +while read ligne +do +username=$(echo $ligne | cut -d ";" -f1) +useradd -m -s "/bin/bash" $username + +group=$(echo $ligne | -d ";" -f5) +usermod -aG $group $username + +echo $username:$passwd | chpasswd +chown $username:$username /home/$username + +done < $fichier \ No newline at end of file