Files
Bash_Scrips/scripts/Loop_AddUser3.sh
2025-06-23 21:19:51 +02:00

18 lines
402 B
Bash

user1,password1
user2,password2
etc..
The script:
for userdetails in `cat /pathto//users.txt`
do
user=`echo $userdetails | cut -f 1 -d ,`
passwd=`echo $userdetails | cut -f 2 -d ,`
echo "useradd -d /user1/kopen3 -p `mkpasswd $passwd` $user"
done
run the script and redirect the output to a file, e.g:
./createusers.sh > userscript.sh
chmod +x userscript.sh