Adding multiple users in ubuntu


#1

Hi guys, i need to add multiple users in ubuntu 14.*, i tried with newuser command & some scripts.
for the newuser command i need to give all the details of the user,pwd,homedir etc, for running the script also i need to give all the details in the file.
but my need is only the username i should give in file rest all of the things like password,UID,GID,SHELL… etc should automatically take
can u please advise how to use or is there any scripts to do the same. please advise


#2

@msp_surya

Hi Surya

Once look at the below link it may help you


#3

ya raghu this is working fine,
but here i had to add all the details like username,password,UID,GID etc in the file and later i execute it adds.
my scenerio is only username i should give in the file ,rest all of the things like password,UID,GID, etc it should automatically take. because for more than 100 users i cannot enter the GID ,UID, manually so can u please suggest some other method


#4

script for adding multiple user
hi,
some how i searched and customized the scripts for adding multiple users through script.
hope it may help for someone.

prerequistes :
add the list of users in the userlist.txt file

script:

#!/bin/bash
password=“123”
for USER in $(cat userlist.txt)
do
useradd -m $USER
echo $USER
echo -e “${password}\n${password}” | passwd $USER
done


#5

Hi,
I also searched and customized the scripts for adding multiple users through script.Please visit best essay writing service for further details.