How to set up a Samba server for Active Directory authentication
last modified
2007-02-19 05:28 PM
Most of the necessary steps are described on this web page. The key steps are as follows:
- Make sure the machine is in your local DNS . This also requires a reverse PTR record.
- Make sure the /etc/network/interface file is set up as follows::
auto eth0 #iface eth0 inet dhcp iface eth0 inet static address 192.168.2.[proper number which is in DNS] gateway 192.168.2.1 netmask 255.255.255.0 network 192.168.2.0 broadcast 192.168.2.255 - Make sure /etc/resolv.conf contains the following::
search <your local domain> nameserver <your local DNS server> - Make sure Ubuntu sources are set up to include the "Universe" repository. Then install the following packages::
samba smbclient smbfs smbldap-tools winbind krb5-config krb5-user
- Configure /etc/samba/smb.conf . Key thing is to add domain.
- Configure /etc/krb5.conf . Key thing is to add domain.
- Get a kerboros key by running::
# net ads join -U Administrator%password Where "password" is <your Windows Domain>\Administrator password. If you leave off "password" you will be prompted for it and it won't be in the history. - You can permanently add the password with the following command (I am not sure if you need to do both)::
# wbinfo --set-auth-user=DOMAIN\\administrator%password See comment above regarding "%password" - Configure /etc/nsswitch.conf
- Restart samba and winbindd:
# /etc/init.d/samba restart # /etc/init.d/winbind restart - Test winbind is working properly:
# wbinfo -u # wbinfo -g - Add domain users and groups to /etc/passwd and /etc/group with the following commands::
# getent passwd # getent group - To check if worked try the following:
# cat /etc/passwd # cd ; touch test # chown "your Windows Domain"+atrauring test # ls -al test - In /etc/pam.d/ make a copy of the original login file. Then configure /etc/pam.d/login .
- Add shares.
- Make sure the share disk has group "your Windows Domain"+domain users
- chmod 770 for directory
- Use webmin to set up share. Set default permissions to 770 and make sure share is writeable.
- Test by connecting to Share in Windows and adding a directory. On Linux side the share should have Domain owner and group and 770 privileges.