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
| Print article | This entry was posted by Siru on August 6, 2012 at 8:41 pm, and is filed under Scripts. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |