LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-25-2009, 06:04 AM   #1
MeeLee
Member
 
Registered: Aug 2009
Posts: 48

Rep: Reputation: 3
Exclamation adduser - the user already exists


Hi,

I am logged in as Root, and in /etc

I try: adduser, but it says that the user already exists.

When you catpasswd, the user I am trying to add is not there.

I have tried userdel, but it comes up with a shadow error...and when you go to add him again, it still says that he exists.

The user did try logging on before he had an account added and he got a message saying "creating directories"...but then it said that "you have been locked out by administrator"

Do you know what I can do to add the user...and also stop this from happening again?

Thanks,

Lee
 
Old 09-25-2009, 06:06 AM   #2
JamesChamberlain
Member
 
Registered: Sep 2009
Location: Wirral, UK
Distribution: Red Hat Enterprise Linux / Fedora 11
Posts: 47

Rep: Reputation: 18
Try unlocking the accountt if it's locked:

passwd -u {username}
 
Old 09-25-2009, 06:09 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Check the /etc/shadow file as well.
When you do stuff, show us the exact cmd and msgs; makes it much easier to help you.
 
Old 09-25-2009, 06:17 AM   #4
MeeLee
Member
 
Registered: Aug 2009
Posts: 48

Original Poster
Rep: Reputation: 3
Thanks.

Apologies - the exact error is:

useradd: *****exists

I can't see him in /etc/shadow either
 
Old 09-25-2009, 07:22 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This isn't a NIS or LDAP issue?
 
Old 09-25-2009, 07:35 AM   #6
MeeLee
Member
 
Registered: Aug 2009
Posts: 48

Original Poster
Rep: Reputation: 3
No no...well I don't think so??

The environment:

The server is authenticating via kerberos...LDAP. to an AD domain (with Windows DCs). The user wasn't locked out of AD...and other active directory users have been able to login to the RHEL server fine.

The fix:

I have managed to get the user to login. I tried creating the account via the "add user" tab on the GUI and was able to successfully create the account along with a home directory (even though the "useradd" command still wouldn't let me).

I then went into /etc/password and etc/shadow and manually changed the user details to match those of other users whom I wanted the account to match.

The only thing with this though, is when I created the account and new home directory, it asked to set a password. I set the password, but when the user logged in, he was able to do it via AD (which is what I want), but not via the new password I had set.

The above is what I wanted, but any ideas why this is the case (why I had to create the new password which wasn't needed anyway?)

Also, Is there anything I need to be wary of due to adding the account this round-about way?

If anyone could shed some light as to why the original issue would have occured in the first place, and how to prevent it from happening again i'd be truly grateful!

Thank you

Lee
 
Old 09-25-2009, 08:08 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
LDAP is doing your authenticating, so the user already exists in the LDAP DB. That's why I asked.
The acct should only be defined in one place. The user probably used the passwd in the LDAP db.
You need to read up on krb & LDAP, if you don't already have it down pretty good. (Apologies if you do)
I used this to start learning LDAP
http://www.linuxhomenetworking.com/w...DAP_and_RADIUS
 
Old 09-25-2009, 08:21 AM   #8
MeeLee
Member
 
Registered: Aug 2009
Posts: 48

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by chrism01 View Post
LDAP is doing your authenticating, so the user already exists in the LDAP DB. That's why I asked.
The acct should only be defined in one place. The user probably used the passwd in the LDAP db.
You need to read up on krb & LDAP, if you don't already have it down pretty good. (Apologies if you do)
I used this to start learning LDAP
http://www.linuxhomenetworking.com/w...DAP_and_RADIUS
Thank you Chris.

Link appreciated. I could do with a more thorough read

Lee
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't add local system user - useradd keeps saying user already exists ADeluiz Linux - Security 5 07-26-2013 03:17 PM
Samba: Returning no such user when user exists Neruocomp Linux - Server 0 07-02-2009 02:48 PM
adduser adds a user but I can't login afterwards sheps126 Linux - Newbie 4 01-16-2009 08:50 AM
Problem re-creating user with adduser Exeunt Slackware 4 04-15-2008 07:37 AM
I have an nfs mounted /home and 'adduser' fails to create a new user dipukm Linux - Software 4 06-01-2004 06:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration