shell script useradd linux | password | bash




The following script will create upto five users and you will need to provide username and password on prompt. You may change this to N number of users by increasing the values from 5 to N numbers that you wish.

# Shell script to create multiple users
for a in 1 2 3 4 5
echo "Enter the name of the user you wish to create"
read a
/usr/sbin/useradd $a
echo "Enter the password for the user $a"
/usr/bin/passwd $a

Thank you for viewing

Leave a Reply

Protected by WP Anti Spam