Solved

useradd

Posted on 2000-04-01
8
604 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
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.

 
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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Guacamole cut and paste issue 3 95
mcrypt_create_iv() is deprecated 4 279
Need BIOS update Linux for MSI X99A motherboard. 4 53
VMware Workstation 12 Player 16 122
This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

856 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