Sharing Files Over a Network Using Samba

How to configure Samba for simple file-sharing

File-sharing using Samba is easy to set up...if you know how. After spending some time fiddling, I have managed to set up a simple shared folder that anyone on the local network can read and write to without needing a password.

I am sure there are many other ways of configuring Samba, but I found this method to be really simple. The first thing to do is to create the shared folder and make the current user the owner:

$ sudo mkdir /home/samba/
$ sudo chown $USERNAME /home/samba/

Now install Samba. In Debian-based Linux distributions, this can be done with the command:

$ sudo aptitude install samba

Next, make a backup of the default Samba configuration file.

$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

To configure Samba, edit /etc/samba/smb.conf and replace the contents of the file with:

[global]
    workgroup = WORKGROUP
    netbios name = samba-server
    security = share
    auth methods = guest
    domain master = no
    wins support = yes
[Shared]
    path = /home/samba
    read only = no
    guest ok = yes
    force user = $USERNAME

The only thing that needs changing is the force user = $USERNAME line. Simply change $USERNAME to the name of the current user.

Finally, restart Samba with the following command and test it!

$ sudo /etc/init.d/samba restart
Posted by Christopher Wassall on Sun, 30 Nov 2008 08:37:01 GMT

Comments

There are no comments yet.

Post a Comment

You must be logged in to post a comment