Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I've got LDAP authentication working fine under CentOS 5.4 - users can log in, a home directory is created. But when they log in, they get this:
Quote:
> ssh user.name@testserver
user.name's password:
Creating directory '/home/user.name'.
id: cannot find name for user ID 1009
id: cannot find name for user ID 1009
[I have no name!@testserver ~]$
Running "getent passwd" as the user turns up nothing. Also, the user's home directory has the wrong group ID:
Quote:
drwxr-xr-x 2 user.name splunk 4096 Nov 3 13:34 user.name/
The LDAP server is configured to allow anonymous reads. Here's my slapd.conf:
Quote:
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/sudo.schema
Users are restricted from logging in based on /etc/security/access.conf entries by group. The user is a member of the right group:
Quote:
# getent group | grep user
dev-web:*:1506:user.name
and the "splunk" group is 506 in the /etc/group file.
All I can find on the error implies it's either a permissions problem on the passwd or group files, which doesn't apply, or anonymous reads must be enabled, which are.
The strange thing is that my user account that can log in fine, which is a member of wheel and also has an ssh key. Not sure if that's relevant.
If I remember correctly, that is caused by /etc/libnss-ldap.conf being readable by root only.
Changing the permissions should solve the problem.
Instead running nscd works too, I believe.
Out of desperation I tried starting nscd, and doing so causes all logins to fail - it doesn't appear to try LDAP at all. Stopping it returns the behavior to "normal" whereby nss_ldap seems to be unable to make anonymous binds.
I now have this working on one server, but not another. I have no idea what the difference is - ldap.conf, nsswitch.conf and pam.d/system-auth are identical. The security certificates are the same and pass openssl checks. But, when I log into one machine it can't get usernames:
Quote:
jwilson@test:[jwilson] 1$ ls -la
total 36
drwxr-xr-x 2 1001 wheel 4096 Nov 5 12:04 ./
drwxr-xr-x 6 root root 4096 Nov 4 18:40 ../
-rw-r--r-- 1 1001 wheel 33 Nov 4 12:45 .bash_logout
-rw-r--r-- 1 1001 wheel 176 Nov 4 12:45 .bash_profile
-rw-r--r-- 1 1001 wheel 124 Nov 4 12:45 .bashrc
-rw------- 1 root root 321 Nov 5 12:04 .history
-rw------- 1 1001 wheel 35 Nov 4 12:57 .lesshst
-rw-r--r-- 1 root root 808 Nov 5 12:03 .tcshrc
However, when I sudo to root, it works.
Quote:
jwilson@test:[jwilson] 2$ sudo tcsh
root@test:[jwilson] 13# ls -la
total 36
drwxr-xr-x 2 jwilson wheel 4096 Nov 5 12:04 ./
drwxr-xr-x 6 root root 4096 Nov 4 18:40 ../
-rw-r--r-- 1 jwilson wheel 33 Nov 4 12:45 .bash_logout
-rw-r--r-- 1 jwilson wheel 176 Nov 4 12:45 .bash_profile
-rw-r--r-- 1 jwilson wheel 124 Nov 4 12:45 .bashrc
-rw------- 1 root root 321 Nov 5 12:04 .history
-rw------- 1 jwilson wheel 35 Nov 4 12:57 .lesshst
-rw-r--r-- 1 root root 808 Nov 5 12:03 .tcshrc
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.