To create user in Linux system use below script.
root@nirmal-desktop:~# vim userscript.sh
#!/bin/bash
for USER in test1 test2 test3 test4
do
useradd -s /bin/bash $USER
mkdir -p /home/$USER
chown $USER:$USER -R /home/$USER
PASSINPUT=`echo $USER|cut -c1-3`123
echo "$USER:$PASSINPUT" | chpasswd
echo "$USER successfully created "
done
##################### Enjoy ########################
No comments:
Post a Comment