2025-03-20 14:10:10 +01:00

21 lines
355 B
Bash

file=./login.csv
while read ligne
do
username=$(echo $ligne | cut -d ";" -f1)
useradd -m -s "/bin/bash" $username
group=$(echo $ligne | cut -d ";" -f5)
usermod -aG $group $username
password=$(echo $ligne | cut -d ";" -f2)
echo $username:$password | chpasswd
chown $username:$username /home/$username
done <$file