LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-27-2010, 03:16 PM   #1
rylphs
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, 03:23 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

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

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


Thanks.
 
Old 08-30-2010, 08:58 AM   #4
rylphs
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, 01:12 PM   #5
rylphs
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, 04:48 PM   #6
rylphs
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.
 
  


Reply


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


All times are GMT -5. The time now is 06:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration