The Samba package provides file and print services to SMB/CIFS clients and Windows networking to Linux clients.
Download (HTTP): http://us1.samba.org/samba/ftp/samba-3.0.4.tar.gz
Download (FTP): ftp://ftp.samba.org/pub/samba/samba-3.0.4.tar.gz
Download size: 14.4 MB
Estimated Disk space required: 123 MB
Estimated build time: 10.5 SBU
Maintainer Recommended patch: http://www.linuxfromscratch.org/patches/blfs/5.1/samba-3.0.4-maintainer.patch
Install Samba by running the following commands:
patch -Np1 -i samba-3.0.4-maintainer.patch &&
cd source &&
install -d /var/cache/samba &&
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--with-piddir=/var/run \
--with-fhs \
--with-smbmount &&
make &&
make install &&
install -m755 nsswitch/libnss_win{s,bind}.so /lib &&
ln -sf libnss_winbind.so /lib/libnss_winbind.so.2 &&
ln -sf libnss_wins.so /lib/libnss_wins.so.2 &&
cp ../examples/smb.conf.default /etc/samba
You may want to run configure with the --help parameter. There may be other parameters needed to take advantage of the optional dependencies.
install -d /var/cache/samba: This directory is needed for proper operation of the smbd and nmbd daemons.
--sysconfdir=/etc: Sets the configuration file directory to avoid the default of /usr/etc.
--localstatedir=/var: Sets the variable data directory to avoid the default of /usr/var.
--with-fhs: Assigns all other file paths in a manner compliant with the Filesystem Hierarchy Standard (FHS).
--with-smbmount: Orders the creation of an extra binary for use by the mount command so that mounting remote SMB (Windows) shares becomes no more complex than mounting remote NFS shares.
install -m755 nsswitch/libnss_win{s,bind}.so /lib: The nss libraries are not installed by default. If you intend to use winbindd for domain auth, and/or WINS name resolution, you need these libraries.
ln -sf libnss_winbind.so /lib/libnss_winbind.so.2 and ln -sf libnss_wins.so /lib/libnss_wins.so.2: These symlinks are required by glibc to use the nss libraries.
cp ../examples/smb.conf.default /etc/samba: This copies a default smb.conf into /etc/samba. This sample configuration will not work unless edited for your site, and renamed smb.conf.
Because of the various uses for Samba, complete configuration is well beyond the scope of the BLFS book. In fact, many complete books have been written on this topic alone. The included documentation, a popular book published by O'Reilly, can be viewed by pointing your web browser to file:///usr/share/samba/swat/using_samba/toc.html.
The built in SWAT (Samba Web Administration Tool) utility can be used for basic configuration, however, before using SWAT you must add an entry to /etc/services and make changes to your inetd/xinetd configuration.
Add the swat entry to /etc/services with the following command:
echo "swat 901/tcp" >> /etc/services
If inetd is used, the following command will add the swat entry to /etc/inetd.conf:
echo "swat stream tcp nowait.400 root /usr/sbin/swat swat" \
>> /etc/inetd.conf
Issue a killall -HUP inetd to reread the changed inetd.conf file.
If xinetd is used, the following command will add the swat entry to /etc/xinetd.conf:
cat >> /etc/xinetd.conf << "EOF" service swat { port = 901 socket_type = stream wait = no only_from = 127.0.0.1 user = root server = /usr/sbin/swat log_on_failure += USERID } EOF
Issue a killall -HUP xinetd to reread the changed xinetd.conf file.
SWAT can be launched by pointing your web browser to http://localhost:901.
For your convenience, boot scripts have been provided for Samba. There are two included in the blfs-bootscripts-5.1 package. The first, samba, will start the smbd and nmbd daemons needed to provide SMB/CIFS services. The second script, winbind, starts the winbindd daemon, used for providing Windows domain services to Linux clients.
Install the samba script with the following command:
make install-samba
If you also need the winbind script:
make install-winbind
The Samba package contains make_smbcodepage, make_unicodemap, mount.smbfs, net, nmbd, nmblookup, rpcclient, smbcacls, smbclient, smbcontrol, smbd, smbpasswd, smbspool, smbstatus, swat, testparm, testprns, wbinfo and winbindd.
make_smbcodepage converts text descriptions of code pages to binary code page files and vice versa.
make_unicodemap converts text Unicode map files to binary, for use in mapping characters to 16 bit Unicode.
mount.smbfs provides /bin/mount with a way to mount remote Windows (or Samba) fileshares.
net is a tool for administration of Samba and remote CIFS servers, similar to the net utility for DOS/Windows.