Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004

    Unanswered: 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


  2. #2
    Join Date
    Jan 2004
    Bordeaux, France
    Have you tried to use my suggestions from your previous thead script for adding a new user ?
    What is the result of your work ?

  3. #3
    Join Date
    Mar 2004
    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
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts