Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding a user

Posted on 2002-05-04
6
Medium Priority
?
176 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

618 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