User anlegen
Version vom 5. Juni 2023, 10:56 Uhr von Thomas.will (Diskussion | Beiträge)
<?---
#!/bin/bash
while read LINE
do
user=$(echo $LINE|cut -f 1 -d :)
mail=$(echo $LINE|cut -f 2 -d :)
pass=$(openssl rand -base64 16 | head -c16)
echo useradd -m -s /bin/bash $user
echo chpasswd $user:$pass
echo "Neues Password für xyz, bitte direkt ändern" | mail -s "xyz accound" $mail
done < $1
-->