Howto build Samba4 on Ubuntu 12.04 LTS
Most Samba4 packages for Ubuntu are outdated or the imap_ad module is missing. So just compile it by yourself or download a precompiled archive including start scripts from here:
https://sourceforge.net/projects/samba4ubuntu/
Build Samba4
Install the build requirements:
1 2 3 4 |
$ apt-get install git build-essential libacl1-dev libattr1-dev libblkid-dev \ libgnutls-dev libreadline-dev python-dev python-dnspython gdb pkg-config \ libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl \ libcups2-dev libpam0g-dev xsltproc git libcap2-dev libdm0-dev libclamav6 |
Checkout the source:
1 2 3 |
$ cd /usr/local/src $ git clone -b v4-0-stable git://git.samba.org/samba.git samba4 $ cd samba4 |
Maybe you want to follow the testing branch which contains all patches for the next stable release. If so, you can just switch to it:
1 |
$ git checkout v4-0-test |
Now you can build samba4. By default the install target dir is
/usr/local/samba.
If you want to change that add, for example
--prefix=/opt/samba4 to the configure command.
1 2 3 |
$ ./configure --with-ads --with-shared-modules=idmap_ad $ make $ make install |
In the source dir there is a backup script which I recommend to use. If you changed the prefix you must also change the paths in the script according to your installation.
1 |
cp source4/scripting/bin/samba_backup /usr/local/samba/bin/ |
Now you should archive your fresh installation for later reuse.
1 2 |
$ cd /usr/local $ tar cvzf samba-4.0.6-37-g45ba921-ubuntu-12.04.tgz samba |
Install Samba4 on a different host
Usually you don’t want to compile samba on the fileserver where it should run. So just copy your tar file from your compile host or from https://sourceforge.net/projects/samba4ubuntu/ to your target host.
Install the runtime requirements:
1 2 3 4 |
$ apt-get install python python-dnspython libpython2.7 libattr1 \ libacl1 libcap2 libgcrypt11 libgnutls26 libgpg-error0 libldap-2.4-2 \ libpam0g libsasl2-2 libtasn1-3 dnsutils libdm0 libcups2 zlib1g \ libmagic1 libpcre3 libclamav6 perl |
the filesystem tools:
1 |
apt-get install attr acl |
for a domain member server you need kerberos:
1 |
$ apt-get install krb5-user |
Extract the archive:
1 |
$ tar xvzf samba-4.0.6*.tgz -C /usr/local |
Add this to your .bashrc . The colon at the end of the second line is important:
1 2 |
export PATH=/usr/local/samba/bin:/usr/local/samba/sbin:$PATH export MANPATH=/usr/local/samba/share/man: |
Create symbolic links to important libraries and run ldconfig:
1 2 3 4 5 |
$ ln -s /usr/local/samba/lib/libnss_winbind.so /lib/x86_64-linux-gnu/ $ ln -s /usr/local/samba/lib/libnss_winbind.so.2 /lib/x86_64-linux-gnu/ $ ln -s /usr/local/samba/lib/security/pam_winbind.so /lib/x86_64-linux-gnu/security/ $ ln -s /usr/local/samba/lib/security/pam_smbpass.so /lib/x86_64-linux-gnu/security/ $ ldconfig |
To use Samba4 acls, add the following mount options to your data filesystems user_xattr,acl . If you use xfs you can also add barrier=1 which ensures that tdb transactions are safe against unexpected power loss.
Now you are ready to configure samba4 either as a DC, backup DC or domain member server.
In short. A fresh domain controller is set up as follows:
1 |
samba-tool domain provision --use-rfc2307 --interactive |
For further information take a look at the samba wiki:
- https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO
- http://wiki.samba.org/index.php/Samba4/HOWTO/Join_a_domain_as_a_DC
Schreibe einen Kommentar
Du musst angemeldet sein, um einen Kommentar abzugeben.