Solved

useradd

Posted on 2000-04-01
8
602 Views
Last Modified: 2010-04-20
RedHat 6.1
Why doesn't the useradd command work anymore.
useradd -u 0 -g 0 user
I then add a password. If I try to log in using this my system is screwed up and I can't fix it. Run level 5 no longer works. Run level 3 won't let you log in using this login. I've reloaded several times trying to figure this out. If you use linuxconf it works OK. What is the differance. I can run X if I change the font path in XF86Config. I know xauth is part of the problem. Psudo passwords are also part of the problem. XFS for one.
0
Comment
Question by:Ted22
8 Comments
 
LVL 1

Accepted Solution

by:
fbjean earned 100 total points
ID: 2676068
I`m not sure , but it may be because you try to use the id  0 for creating a new user.The id  0 is reserve for root only, you should try maybe 200 or more , see the /etc/passwd file for the next available id .

Hope this will help


0
 
LVL 1

Expert Comment

by:jwilcox
ID: 2676513
Are you trying to give the person wheel access, while not being root? then wouldn't useradd -g 0 <user> be good?

If you are just adding a general user why not do useradd <user>, and let useradd figure out the user id and group id?

Hope this helps!
0
 
LVL 1

Author Comment

by:Ted22
ID: 2676915
I've used other users and groups with the same result. As soon as you try to log in with the new user something changes and I don't know how to fix it. I will try not setting a user and group, but I want to load RedHat just for that purpose first.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 1

Expert Comment

by:jwilcox
ID: 2676926
Is useradd the robust version, or is it adduser that is the robust version? Anyway it adduser is the more robust version that in the end calls useradd have you tried that? If I'm remembering correctly that combo always worked really well for me.
0
 
LVL 1

Expert Comment

by:Barn_Owl
ID: 2676990
adduser I think.
0
 
LVL 1

Author Comment

by:Ted22
ID: 2677005
I started doing it one way in RH5.0 and it worked OK up till 6.0 or 6.1. It may have been the wrong way. As soon as I load I will try some things. I'm trying to get some understanding of what's happening.
0
 
LVL 1

Expert Comment

by:jwilcox
ID: 2677081
If it keeps on failing maybe you can look at your user list and notice the descrpency.
0
 
LVL 1

Author Comment

by:Ted22
ID: 2677288
adduser is linked to useradd in /usr/sbin (the same thing)RH6.1
There are a couple of good answers. I'm accepting the first one which I think is the best. I should have realized that I was conflicting with root or one of the other existing users. That is what my problem appears to be. I did it that way with RH5.0, 5.1, 5.2 and it seemed to work OK.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

785 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