Quick samba configuration file example

Here is a quick way to get a samba share up and running with an easy and straightforward smb.conf file.

Edit your /etc/samba/smb.conf file:

# vim /etc/samba/smb.conf

Paste the following into the smb.conf file:

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

[home]
comment = Home Directory
path = /home/adam/
valid users = adam
writable = yes

Setting up Samba users with smbpasswd:

Since we chose to use the security mode “users” in our samba configuration file, we need to set up the users. To do so, run:

adam@foo:~$ smbpasswd -a adam
New SMB Password:
Retype new SMB Password:
adam@foo:~$

Remember, you can only add samba users via smbpasswd if they already exists as real users on the machine. To see the real users, take a look at your /etc/passwd file. Also note, for all users you add in your smb.conf to the valid users line, you must create a password for them using smbpasswd.

Restart samba:

# /etc/init.d/samba restart

You should now be able to access your samba share from a networked Windows machine.  From the Windows computer simply navigate to Start > Run > and enter in the UNC path for the Linux samba server.  An example would be \\192.168.1.100.

For a more detailed explanation of setting up a samba configuration file check out my Simple Samba Slackware Setup guide.

Simple Samba Slackware Setup

If you are wanting to connect your Windows machine(s) to your Linux machine(s) over your network, then Samba is what you need. Essentially, Samba allows your Linux machine to communicate with your Windows network to share files, resources, and printers. This document will cover the steps of installing and configuring Samba on Slackware 11.0.0. Continue reading