If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > how do I add a new user

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-03-04, 23:03
iamagirl iamagirl is offline
Registered User
 
Join Date: Mar 2004
Posts: 10
how do I add a new user

Hi all;

Lets say I'd like to add a new user that shoul have the following feauters:

1.User will belong to one of: mktg, ent, trade, or mgmt groups, based on the Department field

2.Their usernames will be first_last based on the FirstName and LastName fields.
3.User will be created with Bash Shell defaults, under /home with the default /etc/skel template files included in his new home directories.

useradd -d -g $grgpname -m -k /etc/skel -s ???

does my command look ok or not.Also at the end of my command I am suppose to add the new user name right.But what if the name has to be lilke step 2.

How can I do this

Any answer would be great

Belinda
Reply With Quote
  #2 (permalink)  
Old 04-04-04, 06:02
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
Have you tried to use my suggestions from your previous thead script for adding a new user ?
What is the result of your work ?
__________________
Jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 04-04-04, 10:33
iamagirl iamagirl is offline
Registered User
 
Join Date: Mar 2004
Posts: 10
I'm so sorry.I tried to apply your solution,but I didn't get your answer.So what I did is

echo "choose one of the groups to add the user inmktg,ent,trade,mgmt)" grpname

read null
cut -f1 -d":" /etc/group
read grpname

echo "Type a username to add: " usrname
read usrname
clear
useradd -d -g $grpname -m -k /etc/skel -s $usrname * I DON'T THINK THIS LINE IS CORRECT

echo "user" $usrname "has been added to " $grpname "group on your machine"

##Display the records for the new users ONLY from /etc/passwd I DON'T KNOW HOW TO DO THIS PART

so that was my work.Thanks for the answer aigles

Belinda
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On