User anlegen
Version vom 5. Juni 2023, 04:53 Uhr von Thomas.will (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „<syntaxhighlight lang=bash> #!/bin/bash while read LINE do user=$(echo $LINE|cut -f 1 -d :) mail=$(echo $LINE|cut -f 2 -d :) pass=$(openssl rand -bas…“)
#!/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