Samba 4.
Install Samba 4 in Centos 7
Install Required Software
1.
yum install libacl-devel 2.
yum install e2fsprogs-devel 3.
yum install gnutls-devel4.
yum install readline-devel5.
yum install python-devel6.
yum install gdb7.
yum install gcc8.
yum install gcc-c++9.
yum install cups-devel10.
yum install pam-devel11.
yum install ctdb-devel12.
yum install openldap-devel13.
yum install libsmbclient14.
yum install libacl-devel15.
yum install libblkid-devel16.
yum install gnutls-devel17.
yum install readline-devel18.
yum install python-devel19.
yum install gdb20.
yum install pkgconfig21.
yum install krb5-workstation22.
yum install zlib-devel23.
yum install setroubleshoot-server24.
yum install setroubleshoot-plugins25.
yum install policycoreutils-python26.
yum install popt-devel27.
yum install libpcap-devel28.
yum install sqlite-devel29.
yum install libidn-devel30.
yum install libsemanage-python31.
yum install setools-libs-python32.
yum install setools-libs33.
yum install libxml2-devel34.
yum install libacl-devel35.
yum install libsepol-devel36.
yum install libattr-devel37.
yum install keyutils-libs-devel38.
yum install cyrus-sasl-devel
Download and Install Samba
1.
Download Installer
2.
Extract the the compresed installer
-
tar
zxvf samba-4.0.0.tar.gz
3.
Go to the extract directory ant run installer
-
./configure --enable-old-ctdb
4.
Run make
-
make
5.
Run make install
-
make install
Create the startup script (Auto start service)
1.
Create the script
a.
# vi /etc/init.d/samba
#! /bin/bash
#
# samba4 Bring up/down samba4 service
#
# chkconfig: - 90 10
# description: Activates/Deactivates all samba4 interfaces
# configured to start at boot time.
#
### BEGIN INIT INFO
# Provides:
# Should-Start:
# Short-Description: Bring up/down samba4
# Description: Bring up/down samba4
### END INIT INFO
# Source function library.
. /etc/init.d/functions
if [ -f /etc/sysconfig/samba4 ]; then
. /etc/sysconfig/samba4
fi
CWD=$(pwd)
prog="samba4"
start() {
# Attach irda device
echo -n $"Starting $prog: "
/usr/local/samba/sbin/samba
sleep 2
if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then
success $"samba4 startup"; else failure $"samba4
startup"; fi
echo
}
stop() {
# Stop service.
echo -n $"Shutting down $prog: "
killall samba
sleep 2
if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then
failure $"samba4 shutdown"; else success $"samba4
shutdown"; fi
echo
}
status() {
/usr/local/samba/sbin/samba --show-build
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status irattach
;;
restart|reload)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
1.
Give the ownership-
# chmod 755
/etc/init.d/samba-
# chown root:root
/etc/init.d/sambaTo Provision Domain -
#
/usr/local/samba/bin/samba-tool domain provisionConfigure Windows XP/7/8 to join domainInstall RSAT on this PC – You can manage active
directory using this pc. The login name must be administtator.Setup File Share-
#
mkdir /var/share-
#
vi /usr/local/samba/etc/smb.conf[myshare]path =
/var/sharecomment =
The Shareread only
= no |
-