Solved

Adding a user

Posted on 2002-05-04
6
160 Views
Last Modified: 2010-04-22
Please i don't want someone else to do this i just need to know what commands i would use in the korn shell to make a script that will add users and groups along with adding the shodowed password.
0
Comment
Question by:sk33v3
6 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6990266
useradd && groupadd && passwd
0
 
LVL 9

Author Comment

by:sk33v3
ID: 6990494
can't use the useradd program.
0
 
LVL 5

Accepted Solution

by:
bryanh earned 55 total points
ID: 6990683
It's hard to see how you could be prevented from using 'useradd' but still be able to add a user via your own shell script, but I'll take your word for it.

Since you don't want someone else to write the exact code, I presume you're asking what it takes at a higher level to add a user.  It doesn't require any special shell command to do it -- it's just file manipulation.

Different systems have different security and accounting systems, so there's no one answer for everyone.  But I know the commonest cases.

You need to add a line to /etc/passwd and a line to /etc/shadow and typically a home directory to /home.

I myself never try to construct the /etc/shadow entry myself.  I just put a dummy entry in with the proper username and then run the 'passwd' program to set a real password.

You may want to read the /etc/passwd file first to see what usernames and uids are unused.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 6991009
> can't use the useradd program
Why?
Please be more specific.
0
 
LVL 9

Author Comment

by:sk33v3
ID: 6991528
well the assignment is to make a script to add a user without using useradd program. it must also be able to make groups and delete them. i got the delete part down that was easy but my problem is encryting the password in the shadow file.
0
 
LVL 5

Expert Comment

by:garboua
ID: 7006645
KeYword is assignment.  you are not going to get the script from EE, but here is the HeLP

look at /etc/passwd /etc/group for format.
your script Must add an entry to /etc/passwd with user name, user ID, group id, and shell
and to group if you are creating a new group for each user.  if you can create them, you can delete them.

ciao
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
A short film showing how OnPage and Connectwise integration works.

914 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now