Tuesday, December 10, 2013

Install Samba 4.1.3 on Centos 6.5

# Install dependencies
yum -y remove 'samba*'
yum -y install glibc glibc-devel gcc libacl-devel krb5-workstation krb5-libs pam_krb5
yum -y install 'python*'
yum -y install git git-core
yum -y install gdb
yum -y install 'ctdb*' 'libtdb*' 'python-tdb' 'tdb-tools'
yum -y install 'libtalloc*'
yum -y install pytalloc pytalloc-devel
yum -y install libtevent libtevent-devel
yum -y install 'popt*'
yum -y install ldb-tools pyldb pyldb-devel libldb libldb-devel
yum -y install ncurses ncurses-devel ncurses-libs ncurses-base ncurses-term
yum -y install compat-libtermcap
yum -y install migrationtools
yum -y install perl-Parse-Yapp
yum -y install gamin
yum -y install libaio libaio-devel
yum -y install 'cups*'
yum -y install 'pam*' llibcgroup-pam nss-pam-ldapd passwd sssd-client fprintd-pam PyPAM
yum -y install 'ncurses*'
yum -y install 'libtool-ltdl*'
yum -y install 'isomd5*'
yum -y install 'libgcrypt*' 'python-crypt*'
yum -y install 'libcap*'
yum -y install 'bind-devel' bind-libs bind-utils
yum -y install 'avahi*'
yum -y install 'docbook*'
yum -y install 'libacl*'

#Build samba

cd /root
mkdir samba
cd samba
wget http://ftp.samba.org/pub/samba/samba-4.1.3.tar.gz
tar xvzf samba-4.1.3.tar.gz
cd samba-4.1.3
./configure --enable-debug --enable-selftest
make -j 8
make install
service samba start
chkconfig samba on

# Build and install Bind9

cd /root/
mkdir /root/bind
cd /root/bind
wget https://www.isc.org/downloads/file/bind-9-8-6-p1-tar-gz/?version=tar.gz
tar xvzf index.html\?version\=tar.gz
cd bind-9.8.6-P1
 ./configure --with-gssapi=/usr/include/gssapi --with-dlopen=yes
make -j 8
make install
groupadd -g 25 named
useradd -g named -u 25 -d /var/named -M -s /sbin/nologin named
service named start
chkconfig named on

# Provision domain on your AC DC
/usr/local/samba/bin/samba-tool domain provision --use-rfc2307 --interactive

#to query records, use kerberos login
 /usr/local/samba/bin/samba-tool dns query COMPANY.company.com 
company.com @ ALL

#join domain using uppercase to force kerberos
use :  MYDOMAIN.local.com

2 comments:

  1. After compiling successfully, I issue service samba start and get samba: unrecognized service. Weird. All dependencies are installed, except for ctdb* (CentOS tells me that it requires a version of tdb-tools that is not present in CentOS 6.5). Any ideas? (BTW, samba-tool works to provision the domain, but, of course, any further attempts to do anything fail).

    ReplyDelete
  2. Ah, I fugured it out: it is not installed as service anymore (v 4.1.9) but as a standalone tool in /usr/local/samba/sbin

    ReplyDelete