LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   useradd problem with UID calculation (https://www.linuxquestions.org/questions/linux-newbie-8/useradd-problem-with-uid-calculation-828873/)

rylphs 08-27-2010 02:16 PM

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.

AlucardZero 08-27-2010 02:23 PM

Are you connected to NIS? LDAP? What's in /etc/nsswitch.conf ?

rylphs 08-28-2010 08:15 AM

The server is in my work. I'll check on monday.


Thanks.

rylphs 08-30-2010 07:58 AM

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.

rylphs 08-30-2010 12:12 PM

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.

rylphs 08-30-2010 03:48 PM

:redface: After I removed the word "ldap" from the nsswitch.conf file I should have restarted the server. Everything is working now.

Thank you AlucardZero.


All times are GMT -5. The time now is 10:12 AM.