correction script

This commit is contained in:
2025-02-20 14:58:48 +01:00
parent f1011e625f
commit 1eafeed5e9
2 changed files with 23 additions and 13 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/bash
fichier='./login.csv'
while read line
do
username=$(echo $line | cut -d ";" -f1)
useradd -m -s "/bin/bash" $username
# permet l'ajout d'un utilisateur
group=$(echo $line | cut -d ";" -f5)
usermod -ag $group $username
password=$(echo $line | cut -d ";" -f2)
#permet de changer le mot de passe
echo $username:$password | chpasswd
chown $username:$username /home/$username