shell script useradd linux | password | bash

 

Hello,

 

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.

#!/bin/bash
# Shell script to create multiple users
for a in 1 2 3 4 5
do
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
done





Thank you for viewing helpinlinux.com

Leave a Reply

Protected by WP Anti Spam