[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

useradd in unix

Posted on 2007-10-02
5
Medium Priority
?
1,671 Views
Last Modified: 2013-12-27
Hi

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:)
0
Comment
Question by:atwork2003
  • 2
  • 2
5 Comments
 
LVL 38

Accepted Solution

by:
yuzh earned 1000 total points
ID: 20003451
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!
0
 

Author Comment

by:atwork2003
ID: 20003507
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
0
 
LVL 38

Expert Comment

by:yuzh
ID: 20003955
>>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.
0
 
LVL 9

Assisted Solution

by:vsg375
vsg375 earned 1000 total points
ID: 20004858
Hi,

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.

HTH
Cheers.
0
 

Author Comment

by:atwork2003
ID: 20009811
Great help, thank you so much Guys:) Appreciate it very much
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…
Suggested Courses

873 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