Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-11-2011, 04:32 AM   #1
LQ Newbie
Registered: Jul 2011
Posts: 6

Rep: Reputation: Disabled
libnss-ldap: users not being assigned the correct loginshell

Hi, was wondering if anyone can point me in the right direction as to what's going wrong here.

The following is with Debian Squeeze..
I have a kerberos KDC which uses LDAP to store it's DB (set up similar to this howto: and the clients set up similar to this:
(basically using libnss-ldap and ldap over GSSAPI with libpam-krb5 pam modules).

So when a user logs into a client in the realm, libnss-ldap should query the kdc/ldap server for the uid/gid and loginshell etc.
/etc/nsswitch.conf has the following set:
passwd:         compat ldap
group:          compat ldap
shadow:         compat ldap
This works mostly fine and a user, say newuser, can log into a client where no newuser exists locally, only on the kdc/ldap server, the home directory will be created and all is mostly OK.

But what is happening is that the loginshell is not being set correctly.

Once logged in, the user is assigned /bin/sh where the ldap loginshell entry is /bin/bash eg.

$ echo $SHELL

$ ldapwhoami
SASL/GSSAPI authentication started
SASL username: newuser@DOMAIN.CO.UK
SASL data security layer installed.

$ ldapsearch -LLL uid=newuser
SASL/GSSAPI authentication started
SASL username: newuser@DOMAIN.CO.UK
SASL data security layer installed.
dn: uid=newuser,ou=people,dc=domain,dc=co,dc=uk
uid: newuser
uidNumber: 20001
gidNumber: 20001
cn: newuser_firstname
sn: newuser_surname
objectClass: top
objectClass: person
objectClass: posixAccount
objectClass: shadowAccount
loginShell: /bin/bash
homeDirectory: /home/newuser
Now this does eventually seem to sort itself out and starts assigning a bash shellat some seemly random point in the future.. but I've not managed to pin down what changes when it does.

Can anyone suggest any routes for investigation?
Old 08-11-2011, 06:14 AM   #2
LQ Newbie
Registered: Jul 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
I see what is causing this now... just in case anyone comes up against the problem:

If I did a "getent passwd newuser" while logged in as newuser using the newuser@DOMAIN.CO.UK ticket on the client I get:
However if logged in as root and using the host ticket host/ and issued "getent passwd newuser" I could see loginshell was missing:
Since the NSS would try to access the user info via the host ticket, it'll have the same problem.

The HOWTO's ldap access lists include:
olcAccess: to attrs=loginShell
  by self write
  by * none
I made the following change and it now works:

olcAccess: to attrs=loginShell
  by self write
  by * read


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
[SOLVED] Apache authentication: allow LDAP group OR user named guest, but not all LDAP users AlucardZero Linux - Server 1 05-25-2011 03:21 PM
Squid users assigned to different ISPs? mauxiliar Linux - Server 0 11-29-2010 01:02 PM
Openssh + PAM + LDAP fails only with LDAP users asimula Linux - Newbie 2 04-01-2010 07:10 AM
I want to override loginShell value from LDAP server bellman Linux - Newbie 2 03-07-2007 11:29 PM
Changing assigned TTY for logged in users karnick Linux - General 0 03-02-2005 05:13 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:31 PM.

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
Open Source Consulting | Domain Registration