User anlegen: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
(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…“)
(kein Unterschied)

Version vom 5. Juni 2023, 04:53 Uhr

#!/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