Solved

Adding a user

Posted on 2002-05-04
6
171 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
[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
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
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 
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

Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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