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…“)
 
Zeile 1: Zeile 1:
 +
 +
<?---
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
#!/bin/bash
 
#!/bin/bash
Zeile 10: Zeile 12:
 
echo "Neues Password für xyz, bitte direkt ändern" | mail -s "xyz accound" $mail
 
echo "Neues Password für xyz, bitte direkt ändern" | mail -s "xyz accound" $mail
 
done < $1</syntaxhighlight>
 
done < $1</syntaxhighlight>
 +
-->

Version vom 5. Juni 2023, 10:56 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

-->