Samba

From Segfault
Jump to navigation Jump to search

Installation

wget https://www.samba.org/samba/ftp/samba-latest.tar.{asc,gz}
gzip -d samba-latest.tar.gz
gpg --recv-keys 0x6F33915B6568B7EA
gpg --verify samba-latest.tar.asc && tar -xf samba-latest.tar

There's also a git repository:

git clone git://git.samba.org/samba.git samba-git
cd samba-git

Samba3

Building and installing Samba3:

git checkout -b stable origin/v3-6-stable
cd source3
./autogen.sh
./configure --prefix=/opt/samba3 --with-pam && make
sudo make install

For some reason, the resulting binaries are linked to a shared libtevent library, resulting in:

$ ldd /opt/samba3/sbin/smbd | grep not
       libtevent.so.0 => not found

As a workaround, we could use LD_LIBRARY_PATH to use the newly compiled binaries, e.g.:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/samba3/lib /opt/samba3/bin/testparm /etc/samba/smb.conf

Samba4

Samba4 uses waf for its build system:

sudo apt-get install python-dev                   # Debian, Ubuntu
sudo yum install python-devel                     # Fedora, SUSE
  
./configure --prefix=/opt/samba4 --with-pam --without-ad-dc
sudo make install

Configuration

Samba 3

A smb.conf for simple directory sharing with guest-only access and no printers:

#
# /etc/samba/smb.conf
#
[global]
workgroup              = EXAMPLE.ORG
server string          = Samba %v
interfaces             = 127.0.0.0/8 10.0.0.30/32
bind interfaces only   = yes
dns proxy              = no
load printers          = no
printing               = bsd
printcap name          = /dev/null
ea support             = yes

log file               = /var/log/samba/log.%m
log level              = 2
syslog                 = 0
panic action           = /usr/share/samba/panic-action %d
pid directory          = /var/run/samba

security               = user
map to guest           = bad user
guest ok               = yes

# [homes]
# comment              = Home Directories
# browseable           = no
# read only            = yes

[share01]
path                   = /mnt/share01
read only              = no
browseable             = yes
hide files             = /lost+found

[share02]
path                   = /mnt/share02
read only              = yes
browseable             = yes
hosts allow            = 10.0.0.41/32 10.0.0.42/32
force directory mode   = 0755
force user             = root

[cdrom]
path                   = /mnt/cdrom
read only              = yes
browseable             = yes
locking                = no

Note:

 > printing/print_standard.c:68(std_pcap_cache_reload)
 > Unable to open printcap file /etc/printcap for read!

Samba 4

TBD...

Bugs

Links