Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've managed to configure my test Ubuntu 10.04 Beta 2 Server VM to accept logins (via ssh) from users who have domain accounts in active directory via Kerberos, nsswitch.conf and PAM configurations.

The final thing I'd like to happen is locating their home directory on a Windows server share. Each domain account ($USER) has a windows share ala: \\winsrvr\users\$USER.

Can someone push me in the direction I need to go?


Is it possible to maniupulate the template homedir = /home/%D/%U in the /etc/samba/smb.conf file somehow?

share|improve this question

I use automount/autofs to do this with NFS shares, there is probably a way to do it with windows/samba shares as well.

Here is a howto, but I have never tried it.

share|improve this answer
+1 This is how i've done it in the past, worked fine. – GruffTech Apr 21 '10 at 19:53
Agreed, smbfs and autofs play nicely together. Most of the time. :) – EEAA Apr 23 '10 at 21:52
up vote 2 down vote accepted

In a related question I got the answer to this one. Use pam_mount in /etc/pam.d. For Ubuntu, sudo apt-get install libpam-mount.

Other question is here.

share|improve this answer

I for one tried the automount/autofs cifs route but it's really hard going. (Running RHEL5.5 Workstation here.)

I have the linux workstations successfully authenticating on AD via Kerberos, and can mount the shares manually, using the krb ticket granted on login. But can't seems to make it work via autofs, where most often it returns mount error -126.

There's tons of forum posts, etc, with folks trying to do this via autofs but all I can say is that it all seems very brittle. There's lots of complexity under the hood and little details that can go wrong. I'll post my config here in case it helps anyone.

* -fstype=cifs,sec=krb5,user=&,sign,uid=&,rw,filemode=0700,dirmode=0700 ://

This fails unless you set UID=0, which prevents regular users from using it securely...

There's so much more to it-- I'll continued if anybody is interested.

By the way, you'll need keyutils installed and put this on /etc/request-key.conf

create cifs.spnego * * /usr/sbin/cifs.upcall %k
create dns_resolver * * /usr/sbin/cifs.upcall %k

By the way, pam_mount sounds good but isn't available on RHEL5.

The howto posted at the top works, but requires a file that a file with the credentials be on the machine, which isn't feasible on public workstations, etc.

share|improve this answer
I've managed to get this going; I'll be tying all my questions together to summarize. – Jamie Apr 23 '10 at 20:29
Awesome! I'll owe you a beer : ) – André Pitanga May 3 '10 at 13:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.