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:
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.
You now have Samba installed.
- To configure Samba, you will first have to be logged in as root. To switch to root user, go into a terminal and run:
(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:
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)
- Copy/paste the following directives to the newly created Samba config file:
workgroup = WORKGROUP
server string = foo
security = user
load printers = yes
log file = /var/log/samba.%m
max log size = 50
socket options = TCP_NODELAY
comment = My Home Directory
path = /home/someuser
valid users = someuser
writable = yes
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.
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:
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:
mv /etc/rc.d/rc.samba.new /etc/rc.d/rc.samba
chmod 755 /etc/rc.samba
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.