siddou.tk

Mount samba shares with kerberos+auto fs on Debian 8 Jessie

Install autofs and cifs

apt-get install autofs cifs-utils

Configure auto fs

nano /etc/auto.master
+dir:/etc/auto.master.d
/mnt/files                /etc/auto.files           --ghost,--timeout=30
+auto.master
nano /etc/auto.files
#samba shares
share1	-fstype=cifs,sec=krb5,uid=${UID},cruid=${UID}			://samba_server/share1
share2	-fstype=cifs,sec=krb5,uid=${UID},cruid=${UID}			://samba_server/share2
#homes
*		-fstype=cifs,sec=krb5,uid=&,cruid=&			://samba_server/&
systemctl restart autofs

Test

Your kerberos ticket should be valid (check with klist, or else do kinit loginname).
Browse to /mnt/files with the files explorer, you shoud see share1 and share2.
Browse to /mnt/files/loginname, you shoud see your private samba folder.

2 thoughts on “Mount samba shares with kerberos+auto fs on Debian 8 Jessie

  1. Adam Xu

    your post is very nice and your method also woks in CentOS7 with samba AD DC environment. I have searched a lot of posts via Google.but most of them are useless or ugly. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *