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



style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-0857909120009701"
data-ad-slot="1146399101">


Thank you for viewing helpinlinux.com

Leave a Reply

Your email address will not be published.

* Copy This Password *

* Type Or Paste Password Here *

31,751 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Protected by WP Anti Spam