User anlegen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen

<?---

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

-->