Author Topic: [SOLVED]Having trouble with LDAP -can you help?  (Read 29357 times)

morphy_richards

  • Zen Apprentice
  • *
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: Having trouble with LDAP -can you help?
« Reply #15 on: May 21, 2013, 12:04:25 pm »
Not entirely.
I notice in the page you link there is a command to do a manual mount that looks like this:
mount -t cifs //192.168.2.1/C /mnt/Windows-C -o user=name_of_windows_user_account

In my /etc/security/pam_mount.conf.xml on my Ubuntu computer (the one I want to log into using ldap users saved on my zentyal box) I have a command like this:
<volume user="*" fstype="cifs" server="192.168.0.4" path="%(DOMAIN_USER)" mountpoint="/home/%(DOMAIN_USER)" options="sec=ntlm,nodev,nosuid" />

All the manual methods that use "mount" I've seen them use this kind of format:
mount remote_directory local_directory

I tried manually making a /home/test2 on my ubuntu computer
I then did ssh tes2@lovelace
I get this message:

Last login: Tue May 21 11:01:28 2013 from localhost
Could not chdir to home directory /home/test2: No such file or directory

After I exit ssh and look back into the /home directory test2 has disappeared.?





morphy_richards

  • Zen Apprentice
  • *
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: Having trouble with LDAP -can you help?
« Reply #16 on: May 21, 2013, 01:15:12 pm »
I appear to have got it working ...

I dont actually know what I did.

All I did was In my  /etc/security/pam_mount.conf.xml file
<debug enable="1" />

Also - I opened the file /etc/pam.d/common-auth
To check that
auth optional pam_mount.so
was there and it was. So I exited the file without chanign anything.

I then logged in using my ldap test user credentials and instead of seeing the expected "Could not chdir to home directory /home/test2: No such file or directory"
It just ... worked! (???)

morphy_richards

  • Zen Apprentice
  • *
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: Having trouble with LDAP -can you help?
« Reply #17 on: May 21, 2013, 02:29:58 pm »
A little more on this.

I have just created a new ldap user (test3) via the Zentyal users and groups web interface.
I tried to log that user in on a LTSP terminal with no success so i went to the Ubuntu computer and tried to do it in a shell
ssh test3@lovelace
Last login: Tue May 21 13:09:55 2013 from 192.168.1.20
Could not chdir to home directory /home/test3: No such file or directory

192.168.1.x is the subnet for my ltsp clients so it looks like some login happened from here but it was prevented because of the home directory issue.
I can login the ltsp client test2
On the ubuntu computer I can see a directory "test2" in /home. The ldap account "test2" now works.
But I had previously created that directory manually.

If I do
/home$ ls -l

drwxr-xr-x 26 lovelace_admin lovelace_admin 4096 May 21 13:08 lovelace_admin
drwx--x--x 26 test2          __USERS__      4096 May 21 13:07 test2

These exist

If I try to do
mkdir test3
chown test3 test3
I get the following:
Code: [Select]
pam_mount(pam_mount.c:553): pam_mount 2.10: entering session stage
pam_mount(misc.c:38): Session open: (ruid/rgid=1000/1000, e=0/1000)
pam_mount(pam_mount.c:614): no volumes to mount
command: 'pmvarrun' '-u' 'root' '-o' '1'
pam_mount(misc.c:38): set_myuid<pre>: (ruid/rgid=1000/1000, e=0/1000)
pam_mount(misc.c:38): set_myuid<post>: (ruid/rgid=0/1000, e=0/1000)
pmvarrun(pmvarrun.c:252): parsed count value 0
pam_mount(pam_mount.c:440): pmvarrun says login count is 1
pam_mount(pam_mount.c:645): done opening session (ret=0)
pam_mount(pam_mount.c:691): received order to close things
pam_mount(pam_mount.c:693): No volumes to umount
command: 'pmvarrun' '-u' 'root' '-o' '-1'
pam_mount(misc.c:38): set_myuid<pre>: (ruid/rgid=1000/1000, e=0/1000)
pam_mount(misc.c:38): set_myuid<post>: (ruid/rgid=0/1000, e=0/1000)
pmvarrun(pmvarrun.c:252): parsed count value 1
pam_mount(pam_mount.c:440): pmvarrun says login count is 0
pam_mount(pam_mount.c:728): pam_mount execution complete
pam_mount(pam_mount.c:115): Clean global config (1073741824)

but ls -l
still lists owner of test3 as root

ssh test3 still gives "Could not chdir to home directory /home/test3: No such file or directory!











morphy_richards

  • Zen Apprentice
  • *
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: Having trouble with LDAP -can you help?
« Reply #18 on: May 21, 2013, 02:44:27 pm »
Also tried manually creating the directory
/home/test3
I then tried chmod 777 test3

then ssh test3@lovelace
"Could not chdir to home directory /home/test3: No such file or directory"
I then exit

ls -l in /home
and there is only test2, the home directory for test3 has disappeared.

It's very confusing because it works for test2 but not for test3.


morphy_richards

  • Zen Apprentice
  • *
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: Having trouble with LDAP -can you help?
« Reply #19 on: May 21, 2013, 03:05:25 pm »
It's fixed. You need two lines in  /etc/security/pam_mount.conf.xml under  <!-- Volume definitions -->


<volume user="*" fstype="cifs" server="192.168.0.4" path="%(DOMAIN_USER)" mountpoint="/home/%(DOMAIN_USER)" options="sec=ntlm,nodev,nosuid" />
<volume user="*" fstype="cifs" server="192.168.0.4" path="temp" mountpoint="/home/%(DOMAIN_USER)/SRV/temp" options="sec=ntlm,nodev,nosuid" />