|Securing and Optimizing Linux: RedHat Edition -A Hands on Guide|
|Prev||Chapter 31. Software -Server/File Sharing-Network||Next|
Type the following commands on your terminal:
CC="egcs" \ ./configure \ --prefix=/usr \ --libdir=/etc \ --with-lockdir=/var/lock/samba \ --with-privatedir=/etc \ --with-swatdir=/usr/share/swat \ --with-pam \ --with-mmap \ --without-sambabook
The option --with-mmap can give a large performance boost on some machines, while on others it makes no difference at all, and on some it may reduce performance.
This tells Samba to set itself up for this particular hardware setup with:
Include PAM password database support for better security.
Include experimental MMAP support to improve Samba performance.
Don't install the book help that come with Samba distribution.
Now, we must install Samba in the Linux server:
[root@deep ] /source# make all [root@deep ] /source# make install [root@deep ] /source# install -m 755 script/mksmbpasswd.sh /usr/bin/ [root@deep ] /source# rm -rf /usr/share/swat/ [root@deep ] /source# rm -f /usr/sbin/swat [root@deep ] /source# rm -f /usr/man/man8/swat.8 [root@deep ] /source# mkdir -p /var/lock/samba [root@deep ] /source# mkdir -p /var/spool/samba [root@deep ] /source# chmod 1777 /var/spool/samba/
The install command will install the script mksmbpasswd.sh under /usr/bin/ directory. This script is needed to setup Samba users allowed to connect on our server via the smbpasswd file. See later in this documentation for how to setup and use Samba password.
The rm command will remove the /usr/share/swat directory and all the files under it, and it will also remove the swat binary program under /usr/sbin/. The SWAT program is a web-based configuration utility that permits you to configure the smb.conf file of Samba via a web browser interface. Of course, in order to use the SWAT utility you will need to have a web server running, such as Apache. The SWAT utility can open a security breach on your server and for this reason I recommend that you remove and not use it.
The mkdir command will create a /var/spool/samba/ directory on your system for all print sharing jobs you may have. Of course this directory is only necessary if you intend to use Samba print sharing over your LAN. Since we have not configured our Samba server to use print sharing, we do not need to create this directory, /var/spool/samba/ on our server, and we do not need to use the command chmod to change the sticky bit in /var/spool/samba so only the file's owner can delete a given file in this directory.
Please do cleanup later:
[root@deep ] /# cd /var/tmp [root@deep ]/tmp# rm -rf samba-version/ samba-version.tar.gz