You are here

Configuring Samba share on Lucid

Submitted by Druss on Wed, 2010-05-05 00:00

I performed a fresh install of Kubuntu's new distro - Lucid whatever - today. As per usual, there is no front-end to configure Samba and I had to do it the old-fashioned way. The following are steps that should walk you through a basic configuration on creating a share that can be accessed from Windows:

  1. Install Samba using sudo aptitude install samba smbfs
  2. Navigate to /etc/samba/
  3. Create a Samba password for your Ubuntu user account using sudo smbpasswd -a foo where foo is the username. You will be prompted for a password as well.
  4. Create file named smbusers inside the /etc/samba directory.
  5. Open this new file in an editor and add foo = bar inside it where foo is the username we just created a password for and bar is the username of the Windows account which will be access this share. In other words, user bar will become foo when accessing this share.
  6. Save this file and exit the editor.
  7. While I used to shun the default smb.conf that came with Ubuntu, it doesn't appear to be as cluttered as it used to. Ergo, we will use it instead of creating one from scratch. Open smb.conf in an editor. Using Vim: sudo vim smb.conf
  8. There should be a bunch of uncommented settings which you can change. But our chief concern here is to get a share up and running. Look for the setting that states ;security = user. Uncomment it.
  9. Beneath it, add username map = /etc/samba/smbusers to direct Samba to use our newly created user and password pairs.
  10. Scroll down to the bottom of the file and paste in the following:
       comment = My downloaded files
       path = /media/data1/downloads
       guest ok = no
       browseable = yes
       writable = yes

    The above fields should be self-explanatory.
  11. Save the file and exit the editor.
  12. Restart Samba using sudo initctl restart smbd

... and that should do it. Try accessing the share from Windows to ensure that all is kosher.

Please feel free to point out any issues using the comments form below.