?
Solved

Adding a user

Posted on 2002-05-04
6
Medium Priority
?
174 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 220 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
Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month10 days, 2 hours left to enroll

762 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