Centos – Error on LDAP Login – xsessions error – Session lasted less than 10 seconds

centosldapopenldap

I have two machines both running CentOS 5.6 64bit.
On the LDAP Machine it has a DHCP, BIND and OpenLDAP Server. LDAP is correctly configured and users can authenticate against it.

Using root I configure machine 2 to use LDAP for authentication and when trying to log in it successfully authenticates against a saved user on the LDAP Server but produces the following errors and then throws me back to the login screen. I can still sign in as root and use the machine as normal. The syslog doesn't show any errors and I disabled SELinux to see if it was interfering.

The error;

Your session only lasted less than 10 seconds. If you have not lgoged out yourself, this could mean that there is some installation problem or that you may be out of diskspace. Try logging in with one of the failsafe sessions to see if you can fix this problem.

There is then a tickbox to view the contents of ~/.xsessions-errors which contains;

/etc/gdm/PreSession/Default: Registering your session with utmp
/etc/gdm/PreSession/Default: running: /usr/bin/sessreg -a -u /var/run/utmp -x "/var/gdm:0:Xservers" -h "" -l ":0" "admin"
        localuser:admin being added to access control list
    No profile for user 'admin' found
    /bin/sh: /usr/bin/dbus-launch --exit-with-session /etc/X11/Xinit/Xclients: No such file or directory
    /bin/sh: line 0: exec: /usr/bin/dbus-launch --exit-with-session /etc/X11/xinit/Xclients: cannot execute: No such file or directory

Apologies if someone notices something isn't spelt quite right or doesn't sound right, the system never actually creates or saves this file so I have had to type it across from the screen.

Through the authentication panel in CentOS on the client I have set it to create the users home directory on login. The user is being correctly authenticated and the /home/admin folder has been created but this error would suggest it has not? The client is a new install on an 80gb hard drive so there is well over 80% of the drive still available.

Thanks for any suggestions or pointers.

Best Answer

Ok. So the error was not defining /bin/bash as the loginShell attribute for the user on the LDAP server. Because of the permissions on the system and bash being used the default shell on the system it was having errors to try and create the default files required for the x11 system. Adding the /bin/bash loginShell atribute to all users fixed everything