Easy steps to install SAMBA on Slackware 11.0

Jan 8, 2007 08:49 GMT  ·  By

Samba (the Linux implementation of the Server Message Block protocol) is an Open Source suite that provides seamless file and print services to SMB/CIFS clients. Basically, it allows both Linux and Windows users to use each other's SMB file shares as if they were a hard disk on their own machine. A mapped network drive (Windows) or a mounted smb share (Linux) can look, feel and act like your own disk space, but it's really a disk space on some other computer somewhere on the network. Samba also provides print services for various Windows clients and can also integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a Domain Member. Moreover, it can be part of an Active Directory domain. This article will explain how to install and configure Samba on Slackware 11.0 but it should work with older Slackware builds as well.

Download and install

- Fist of all, you should check if Samba has been selected during Slackware installation. To check if you already have Samba installed, run:

code
less /var/log/packages/samba*
If you get a "No such file or directory" error, proceed to installing Samba, otherwise skip this section completely.

- At this time, the latest Slackware version of Samba is 3.0.23c. Click HERE to visit the Samba package info and download for Slackware-latest. - Choose the closest mirror to you and copy the download link. - Next:

code
wget http://closest.mirror.download.link/samba-3.0.23c-i486-1.tgz
installpkg samba-3.0.23c-i486-1.tgz
You now have Samba installed.

Configuration

- To configure Samba, you will first have to be logged in as root. To switch to root user, go into a terminal and run:

code
su -
(Enter root password)
Samba can be configured through its smb.conf file. By default, this file resides in /etc/samba. However, the first time you install Samba, that file *should* be called smb.conf-sample. The recommended way to get Samba up and running is by creating a new smb.conf file with the basic directives and later on, add new directives to suit your system and network configuration. So follow these steps:

- Move an eventual smb.conf file:

code
mv /etc/samba/smb.conf /etc/samba/smb.conf.OLD
(it's ok if you get a no such file or directory error)
- Create a new file and open it up with your favorite editor (i'll use nano)
code
touch /etc/samba/smb.conf
nano /etc/samba/smb.conf
- Copy/paste the following directives to the newly created Samba config file:
code
[global]

workgroup = WORKGROUP
server string = foo
security = user
load printers = yes
log file = /var/log/samba.%m
max log size = 50
socket options = TCP_NODELAY

[home]

comment = My Home Directory
path = /home/someuser
valid users = someuser
writable = yes
Directives explanation:

[global]

workgroup - Enter here the NT Domain Name or Workgroup Name currently set for your network. server string - Used for showing a description related to the Linux server. security - Sets the Authentication Mode to user. You will gain access to Linux shares only when using a username and password. (We'll set these later). load printers - Set this to No if there are no printers connected to the Linux server. log files - Defines the file that will store Samba events, alerts and errors. max log size - Sets the maximum size for the log file, in Kb. socket options - Specifies the options set on the client socket. The TCP_NODELAY option was reported as the option that makes the biggest difference in performance for most networks. [home]

comment - Used for showing a description related to the user share. path - Defines the shared directory. valid users - Sets the users (see /etc/passwd for a valid user list) allowed to access this share. writable - Allows valid users to write to this shared directory.

- Because the Authentication Mode was set to User, you'll now have to create a new samba user:

code
smbpasswd - a someuser
(Enter the new password for this user)
The 'someuser' must be the same user as the one set in the valid users directive in smb.conf. Moreover, this user must also be a valid Linux user (has to be listed in /etc/passwd).

Run and load at boot

Samba can be started using the RC file that came with the Samba package. This RC file is called rc.samba and should reside in /etc/rc.d. However, this file *COULD* be called rc.samba.new or it could not be set as executable. To make sure everything is set up correctly and to start Samba, run the commands:

code
mv /etc/rc.d/rc.samba.new /etc/rc.d/rc.samba
chmod 755 /etc/rc.samba
/etc/rc.d/rc.samba start

Test the installation

First, make sure that ports 139 and 445 (both TCP and UDP) aren't blocked by the Linux firewall. Then go to a computer in the network and open a file browser. In the address bar, write the following address (replace 10.10.0.1 with the correct Linux LAN IP):

You should be prompted by a username and a password. Enter the ones configured using smbpasswd and you should be granted access to the Samba share.

Photo Gallery (2 Images)

Open gallery