Samba Configuration Example

By sean on May 09, 2012

Over the years I've had many fights with Samba. Some won, some lost; but overall, Samba is a great piece of software for sharing data across networks. In this example, we'll be setting up a simple Samba share that can be accessed (without restriction) via Windows or any other environment.

First we'll need to install Samba if it isn't already using your preferred package management system. Depending on your distribution, most repositories carry Samba. Afterwards, you'll probably want to make a backup of the original configuration.

sudo apt-get install samba
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

Now there are a few things you will want to know before moving forward.

  • The "path", which is the file location we want to access
  • The "share" name, which we will be using to access the share
  • The "workgroup" relative to the windows machine
  • The "netbios" name which is generally the hostname of the machine running Samba

Once we have that information we can proceed with creating our samba configuration using your favorite editor.

sudo nano /etc/samba/smb.conf

Then paste in the following; adjusting to your steup

workgroup = MSHOME
netbios name = media
wins support = yes
guest account = nobody
security = share

# our share name in [share]
# our share path
path = /home/Sean/Movies
writeable = yes
browseable = yes
guest ok = yes
guest account = nobody
public = yes

path = /home/Sean/Pictures
writeable = yes
browseable = yes
guest ok = yes
guest account = nobody
public = yes

Then restart the Samba service

sudo service samba restart

Now you should be able to access your share from any other machine






Sign in to comment.
Hawkee   -  May 09, 2012

@sean Ah, I see that.

sean   -  May 09, 2012

@Hawkee I did. I said "using your preferred package management system."

Hawkee   -  May 09, 2012

This assumes you have apt-get installed. You might want to note that or at least indicate your target OS.

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.