Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-27-2010, 02:16 PM   #1
LQ Newbie
Registered: Aug 2010
Posts: 17

Rep: Reputation: 0
Question useradd problem with UID calculation

I am having problems with the useradd command. When I call "useradd someuser" the program starts and never finish. When I give the UID option (useradd -u ) sometimes it works properly, but with some UID's that aren't in /etc/passwd it shows a message saying that the uid is not unique. I checked out /var/log/auth.log and nothing about the command is being logged.

It seems that the command is not calculating the new UID prperly. My someone help me?

It's running on a Debian Linux 2.6.26-2-686 i686 GNU/Linux

Thank you, and sory for my bad english.
Old 08-27-2010, 02:23 PM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Are you connected to NIS? LDAP? What's in /etc/nsswitch.conf ?
Old 08-28-2010, 08:15 AM   #3
LQ Newbie
Registered: Aug 2010
Posts: 17

Original Poster
Rep: Reputation: 0
The server is in my work. I'll check on monday.

Old 08-30-2010, 07:58 AM   #4
LQ Newbie
Registered: Aug 2010
Posts: 17

Original Poster
Rep: Reputation: 0
cat /etc/nsswitch.conf
# /etc/nsswitch.conf
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat ldap
group: compat ldap
shadow: compat

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

How can I know the server is connected to NIS or LDAP? If its connected to LDAP, the uid must be unique considering the LDAP database? What the "compat" word in password, group and shadow means?

Thank you, and sory for the big ammount of questions.
Old 08-30-2010, 12:12 PM   #5
LQ Newbie
Registered: Aug 2010
Posts: 17

Original Poster
Rep: Reputation: 0
It seems that the problem is really related with nsswitch.conf file. I removed the word "ldap" from file and now "adduser" is adding the user normally, but when I add the parameter "-u 200" it's still displaying the error saying that the UID is not unique.
Old 08-30-2010, 03:48 PM   #6
LQ Newbie
Registered: Aug 2010
Posts: 17

Original Poster
Rep: Reputation: 0
After I removed the word "ldap" from the nsswitch.conf file I should have restarted the server. Everything is working now.

Thank you AlucardZero.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Ubuntu default useradd uid lewkh Linux - General 4 07-27-2010 03:37 PM
problem with process time calculation aloktiagi Linux - Newbie 3 08-11-2009 12:05 PM
Changing the UID of a Physical Volume to a specific UID jambraun Linux - Newbie 2 02-09-2006 02:34 PM
FREEBSD5.3 platform: PHP setcookie() successful, but $uid = $_COOKIE['uid']; fail tclwp Programming 1 03-30-2005 08:05 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:16 AM.

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