I have two opening remarks to make:
- Very carefully! ;-)
- You haven't really given enough information for an intelligent answer.
One of the variables involved here is weather or not you are running in a shadow'ed environment or not. This will slightly change the methodology. The basic steps of adding
an account to a Unix (or Linux) box are as follows:
- Collecting the user information
- User Account Name
- User's personal name
- Their password or generating a default password
- Decide where their home directory is going to live.
- Decide what shell they are going to use. (/bin/false?)
- Generate a crypted version their password
- Decide what numerical userid/groupid(s) they are being assigned
- write their /etc/password entry and optionally their /etc/shadow entry.
- create their home directory
- set the home directory's permissions and ownership
- copy any /etc/skel files or other standardized configuration files to the home directory and set their permissions and ownerships.
- drink a beer
Now that I have given you a short course on how to generate a unix account, you should be able to use the above guide to write your script. Really... it isn't all that hard...
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Peter L. Berghold --- Peter@Berghold.Net
"Those who fail to learn from history are condemned to repeat it."
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.