useradd in unix

Posted on 2007-10-02
Last Modified: 2013-12-27

I used this command to add user to the group file:

File: /etc/group
Command: useradd -d /home/lsam lsam

It created the user but I dont see the user in the group while nither I can see a home dir created for the user in the path /home/Isam.

I thought I used command incorrectly so I tried to run it again and I get error that user already exists. I am not sure how to find this user and where is the user created. NEED HELP:)
Question by:atwork2003
    LVL 38

    Accepted Solution

    You can find the user account information in /etc/passwd (and /etc/shadow file).

    To modify a user you can user usermod command.

    I think it is easier to use GUI tool to add and modify users for you.
    For Solaris 8 and older, run admintool (GUI), for Solaris 9 and newer
    run smc.

    Please remember to post your OS version when you ask question in the
    Solaris or other *nix relatived TAs, thank you!

    Author Comment

    Thank you for the help. I found the user in the passwd file. But I am not sure why didnt the command created the user directory in the /home directory
    LVL 38

    Expert Comment

    >>But I am not sure why didnt the command created the user directory in the /home directory

    because you use -d option to tell useradd command to do so.
    man useradd
    to learn more details.
    LVL 9

    Assisted Solution


    The user's PRIMARY group is listed in /etc/passwd (4th field  username:x:UID:GID).  You will frind that user in /etc/group ONLY if that user has one ore more SECONDARY groups defined.

    If you want to add one or more secondary groups for this user, use the -G option with useradd or usermod.


    Author Comment

    Great help, thank you so much Guys:) Appreciate it very much

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
    This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now