Quick-HOWTO: Setting Samba Shares on Slackware Linux.

I am a little short on time. This is a small write-up, briefly going through the instructions on setting up Samba shares on Slackware.

Samba stores its config and data files in /etc/samba/. Samba uses a single config file named “smb.conf”. If you have not played with Samba on your Slackware machine, chances are there won’t be any smb.conf in /etc/samba. There will, however, be an example smb.conf file by the name of “smb.conf-example”. I suggest you go through that file thoroughly to understand the various options supported by Samba and how the shares are set up.

Let’s quickly create a few shares. As root, create the file /etc/samba/smb.conf. In that file, we are going to list down global options (which, as the adjective suggests, apply globally) and the shares we want to enable access to. I am not going to explain the syntax or what each directive or keyword means. You should read the manpage for smb.conf(5) – type `man smb.conf` on a terminal to access the manpage.

That said, I have the following in my /etc/samba/smb.conf:

workgroup = homenet
encrypt passwords = Yes

comment = sec-tools
path = /home/ayaz/downloads/tarball/security
read only = Yes
guest ok = Yes

comment = home
path = /home/
read only = Yes
guest ok = No

comment = writable share
path = /home/share/
read only = No
guest ok = No

I have a global block – the one starting with “[global]” and ending before “[test]”. All you need to know right now is that workgroup should be consistent throughout the network, and that Samba should encrypt passwords, otherwise versions of Windows from 2000 upwards won’t be able to communicate with Samba.

Right after the global block, we have defined three share blocks in series. The string that goes within the square brackets is an arbitrary name for the share. Here, we have set up three shares. In order to understand what each keyword in each share means, refer to the manpage of smb.conf(5).

Once you’ve set the global options and shares in the file, you need to create at least a single user with access to the shares. For that, we will use the smbpasswd(8) utility. As root, do the following to create a user “test”:

root# smbpasswd –a test

It will prompt for password for the test user. Again, I suggest you read the manpage for smbpasswd(8) to understand the various options it supports.

After you’re done through with all this, you need to ensure that the smbd and nmbd daemons are running. Ensuring that in Slackware is simple. Simply do the following:

root# chmod +x /etc/rc.d/rc.samba
root# /etc/rc.d/rc.samba start

That’s it.

4 thoughts on “Quick-HOWTO: Setting Samba Shares on Slackware Linux.

  1. Pingback: How to configure users for samba service » www.cyecorp.net

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s