<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.3.2">
</HEAD>
<BODY>
No, there isn't.  I never use the GUI on any GNU/Linux or BSD box to administer user accounts.  I would make three modifications right away to your script, though.<BR>
<BR>
1.)  It should use the uppercase "G" parameter instead of the lowercase "g" parameter.  Red Hat-based distros, including Fedora Core, will by default put the userID in a "private group" with the same name as the userID.  Once I got used to it, I realized that this is a Good Thing (TM) for both security and future maintenance purposes.  For example, next year, when Kayla Abad and her classmates go to Grade 4, you don't have to touch every userID in /etc/passwd (DANGEROUS!!!), but rather just rename the group "Grade3" to "Grade4" in /etc/group (MUCH safer and MUCH easier).<BR>
<BR>
2.)  The "p" parameter needs to come before the userID.  You have it afterward, so you may well be making a userID of "<FONT COLOR="#000000">kabad -p kaab</FONT>", which, I'm fairly confident, was not your intention.  The other possibility is that you got a parsing error.  I'd have to try it out on a test box to make sure which possibility actually takes place.  You might want to look at your /etc/passwd file to find out what's going on.<BR>
<BR>
3.)  The "m" parameter should be used instead of the "d" parameter.  The "d" parameter, I've learned, works if the specified directory is already created.  But what if it isn't?  The "m" parameter handles this.  If the specified home directory (in your example, /home/kabad) doesn't already exist, then useradd will go ahead and make it for you.  If it does exist, useradd will simply use the existing one.  Yes, there are in fact special cases in which the "d" parameter would come in handy.  But I think you really want "m".<BR>
<BR>
Anyway, your useradd command to create the users should look like this:<BR>
<BR>
<FONT COLOR="#000000">useradd -c "Kayla Abad" -</FONT>m<FONT COLOR="#000000"> /home/kabad -</FONT>G<FONT COLOR="#000000"> Grade3 -p kaab</FONT> <FONT COLOR="#000000">kabad</FONT><BR>
<BR>
I notice that you're generating the userID, home directory, and password from differing parts of the student's first and last name.  If you have a flat text file with each child's first and last name, you actually can get fancy and generate the userIDs, home directories, and passwords in a shell script as well.  See the Advanced BASH Scripting Guide (<A HREF="http://www.tldp.org">http://www.tldp.org</A>) for more details.<BR>
<BR>
--TP<BR>
<BR>
<BR>
On Thu, 2005-09-29 at 19:43 -0700, gKw-X wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">I went in today and ran my script. It appeared to create all of the </FONT>
<FONT COLOR="#000000">accounts and groups properly - I went into the users and groups manager </FONT>
<FONT COLOR="#000000">ui and they were all there. However, I couldn't log in to them from </FONT>
<FONT COLOR="#000000">client machines. If I manually create an account through the ui, I can </FONT>
<FONT COLOR="#000000">log in to it, but if I use the useradd command I can't. Is there some </FONT>
<FONT COLOR="#000000">extra step to notify K12LTSP about the new accounts?</FONT>

<FONT COLOR="#000000">Samps wrote:</FONT>
<FONT COLOR="#000000">> gKw-X wrote:</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">>> I need to create a large number of accounts. I've whipped up a program </FONT>
<FONT COLOR="#000000">>> to generate a script from a text list of students. What it generates </FONT>
<FONT COLOR="#000000">>> looks like this:</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> groupadd "Grade3"</FONT>
<FONT COLOR="#000000">>> groupadd "Grade2"</FONT>
<FONT COLOR="#000000">>> groupadd "Grade1"</FONT>
<FONT COLOR="#000000">>> groupadd "Grade6"</FONT>
<FONT COLOR="#000000">>> groupadd "Grade7"</FONT>
<FONT COLOR="#000000">>> groupadd "Grade4"</FONT>
<FONT COLOR="#000000">>> groupadd "GradeK"</FONT>
<FONT COLOR="#000000">>> groupadd "Grade5"</FONT>
<FONT COLOR="#000000">>> useradd -c "Kayla Abad" -d /home/kabad -g Grade3 kabad -p kaab</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Etc, one useradd line for each student. Does that look correct? I'm </FONT>
<FONT COLOR="#000000">>> still new to linux, how can I run this script?</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> _______________________________________________</FONT>
<FONT COLOR="#000000">>> K12OSN mailing list</FONT>
<FONT COLOR="#000000">>> <A HREF="mailto:K12OSN@redhat.com">K12OSN@redhat.com</A></FONT>
<FONT COLOR="#000000">>> <A HREF="https://www.redhat.com/mailman/listinfo/k12osn">https://www.redhat.com/mailman/listinfo/k12osn</A></FONT>
<FONT COLOR="#000000">>> For more info see <<A HREF="http://www.k12os.org">http://www.k12os.org</A>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">> Add a line at the top of your script to tell it where to find its </FONT>
<FONT COLOR="#000000">> command interpreter:</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> #! /bin/bash</FONT>
<FONT COLOR="#000000">> groupadd "Grade3"</FONT>
<FONT COLOR="#000000">> groupadd "Grade2"</FONT>
<FONT COLOR="#000000">> groupadd "Grade1"</FONT>
<FONT COLOR="#000000">> groupadd "Grade6"</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> (you can find the name of your shell (/bin/bash) by typing echo $SHELL </FONT>
<FONT COLOR="#000000">> on a commandline)</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> save your script and make it executable by changing its attributes:</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> chmod +x yourscript</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> or</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> chmod +x /path/to/yourscript</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> if you're not "standing right next to it"</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> run it by typing :</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> /path/to/yourscript</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> or</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> ./yourscript</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> if you're able to "see" it from where you are...</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> cheers</FONT>
<FONT COLOR="#000000">> Samps</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> _______________________________________________</FONT>
<FONT COLOR="#000000">> K12OSN mailing list</FONT>
<FONT COLOR="#000000">> <A HREF="mailto:K12OSN@redhat.com">K12OSN@redhat.com</A></FONT>
<FONT COLOR="#000000">> <A HREF="https://www.redhat.com/mailman/listinfo/k12osn">https://www.redhat.com/mailman/listinfo/k12osn</A></FONT>
<FONT COLOR="#000000">> For more info see <<A HREF="http://www.k12os.org">http://www.k12os.org</A>></FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>

<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">K12OSN mailing list</FONT>
<FONT COLOR="#000000"><A HREF="mailto:K12OSN@redhat.com">K12OSN@redhat.com</A></FONT>
<FONT COLOR="#000000"><A HREF="https://www.redhat.com/mailman/listinfo/k12osn">https://www.redhat.com/mailman/listinfo/k12osn</A></FONT>
<FONT COLOR="#000000">For more info see <<A HREF="http://www.k12os.org">http://www.k12os.org</A>></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>