Solved

how to creat linux users without interact with the console?

Posted on 2013-01-04
1
559 Views
Last Modified: 2013-01-17
Dear experts,
I have following requirements:
I must create much users in the centos linux server.
I can do it manually with useradd and passwd command.
But since i have this action done hundreds of times, is there any script who can create the
user and set his password without any interact with console?

Thanks a lot for your valuable information.

Best Regards,
Robert
0
Comment
Question by:matiascx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 79

Accepted Solution

by:
arnold earned 500 total points
ID: 38746357
You have a file with username encrypted_password group
cat filename | while read a b c ; do
If  ( grep "$a" "/etc/passwd" >/dev/null) ; then
 echo alread exists
else
echo useradd -g $c -m -d /home/$a -p "$b" $a
fi
done

If the output is in the correct format, remove echo and let it run
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question