Ubuntu 14.04 LTS: File Sharing With Samba

Last updated: May 6, 2014

This tutorial will show you how to install and configure Samba, a free software that allows you to share files, printers and other common resources across a network, in Ubuntu 14.04 Trusty Tahr.

1. Install Samba and the graphical configuration tool:

Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, paste the command below and hit run:

sudo apt-get install samba samba-common system-config-samba python-glade2 gksu

2. Open Unity Dash, search for and open the samba configuration tool:

samba graphical configuration tool

3. When the tool opens, go to Preferences -> Server Settings.

Under Basic tab:

  • Workgroup. Same to your Windows Workgroup name (case-sensitive). In Windows 7, right-click Computer icon and go to Properties, there you’ll see Windows Workgroup name.
  • Description.This is the name of your computer as seen by Windows Users.

As it is not advisable to allow ‘Guests’ there should be no reason to change the ‘security’ settings tab unless you wish to do so.

Finally click the OK button to save it.

(Optional) 4. Create a special user for network file sharing

Go to System Settings -> User Accounts -> Click unlock -> Click + (plus) icon -> Choose Standard account and type in names.

Remember to set a password to enable the new account.

5. Next go to Preferences -> Samba Users. Click Add User:

  • Unix Username: Select a user on this Ubuntu machine. You’ll access the shares from Windows machine with this user privilege. You can create a special user for file sharing by step 4
  • Windows Username: When accessing from Windows machine, you’ll be asked to type this username and the password below.
  • Samba password: When accessing from Windows machine, you’ll be asked to type the username above and this password.
  • Confirm Samba password.

Finally, restart Samba service and done!

sudo restart smbd && sudo restart nmbd

To share a folder, click the green + (plus) button in Samba Server Configuration tool and you can then easily set the directory, name, read/write permissions and access users.

Tips: If you set the Unix Username to current login user in step 5, you can easily share a folder by “Local Network Share” option in its context menu.

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

39 responses to Ubuntu 14.04 LTS: File Sharing With Samba

  1. Gracias, me ayudo mucho, felicidades. Saludos desde Venezuela

  2. this is good work i can help you to translate in dutch if you need it

  3. He intentado usar esta informacion pero me tira el siguiente error:

    The following packages have unmet dependencies:
    samba : Depends: samba-common (= 2:4.1.6+dfsg-1ubuntu2) but 2:4.1.6+dfsg-1ubuntu2.14.04.1 is to be installed
    Depends: samba-common-bin (= 2:4.1.6+dfsg-1ubuntu2) but 2:4.1.6+dfsg-1ubuntu2.14.04.1 is to be installed
    Depends: samba-dsdb-modules but it is not going to be installed
    Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2) but 2:4.1.6+dfsg-1ubuntu2.14.04.1 is to be installed
    Recommends: attr
    Recommends: samba-vfs-modules but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.

    Podrias ayudarme??

    Gracias de antemano

    • Fresh installed system? Go to Unity Dash -> Software & Updates, make sure the first 4 boxes are checked. Then update package lists by:

      sudo apt-get update

      If the error still exists, you must have installed something that conflict to samba in default Ubuntu repositories.

  4. Do you know how to fix this error? ‘net usershare’ returned error 255: net usershare add: share name games is already a valid system user name Thank you.

  5. Perfect!!!

  6. Thanks, it worked perfectly. My Ubuntu system was not accessible by name but got it through the IP.

  7. Worked per your instructions. This was on a home (wireless) LAN with a Mac Book Pro and Ubuntu 14.04. Thank you for your help/article. It is not the first one that I have used with no difficulty.

  8. Filip Oščádal (FredBrooker) July 27, 2014 at 11:50 am

    does not work for me :] tried several other options, no luck

  9. It’s not working for me. I followed this step by step and also tried doing it directly from the terminal. Does the Windows username have to be equal to the username I specify?

  10. Thanks. This helped me get file sharing working after many previously failed attempts. :)

  11. I am following step by step, and when “password required for workgroup” window appears n i insert password workgroup windows, its nothing, can you help what wrong with my setting?

  12. Please can you assist, when I click on Samba it is not opening the samba configuration tool

  13. Hoover Campoverde September 7, 2014 at 1:08 pm

    Thank you so much Ji m. You helped a lot with your article. I’m using Ubuntu 14.04LTS amd64 on my notebook and Windows 8.1 Pro x64 PC Desktop, and now I can share my files easily at home.

  14. This is a great help. I was able to share a directory to my Boxee but I still am required to type in a user name and password. Is there any way to share something on SAMBA to a share that requires no login? A media server needs a public share :(

  15. Installed samba as said. Samba is not even opening up! why?

  16. When i click on samba, from the dash, it does not open. Ubuntu 14.10. Any help? Thanks

  17. Thanks, i manually set my ip adress on the ubuntu computer

    ubuntu 14.04 lts

  18. Perfect Thank You! I use IP Address to access though for so unknown reason I can’t find my linux box from windows any other way if anyone else is having issues just go to your home directory in windows and type in the linux computer’s ip address like this \\192.168.1.xxx whatever your last digits replace where x is and press enter hope that helps someone

  19. thank you! your article works like magic on me….

  20. Kari-Pekka Pyylampi June 24, 2015 at 7:23 am

    Just to save some other guy some hours of work and frustration: Please do not try to share a Samba folder from your encrypted private home folder. It does not work for very obvious reasons. :) Create a folder elsewhere on the system eg. /srv/share and share this folder instead…

  21. Is not really working. Did all the settings, but when I tried to open the folder from a Windows client from the lan, it does not recognize the username and password. I appreciate the time you put in to help but, it is not really working.

  22. Hi,

    Didn’t work for my LUbuntu…it doesn’t have the unity dash…if i open it thru system tools…it ask for password…upon entering the password, it will just close and open nothing….

    Any help/suggestion on how to proceed is highly appreciated.

    Thanks,

  23. Thank you very much for your very useful support, except for the end/

    “Finally, restart Samba service and done!”

    “sudo restart smbd && sudo restart nmbd”

    This does not work for my Ubuntu Mate 15.10 installation; instead I used:

    sudo service smbd restart && sudo service nmbd restart

    many thanks.

  24. how to access a kernel of one ubuntu system in another ubuntu system?

  25. Hello Ji m,
    I am trying to connect shared folder from my other computer in my local network. My other computers is running windows 7 and windows 10. Also I see shared Ubuntu folders in other computers under windows.
    when in nautilus file browser connect button is disabled.
    Do you have any suggestions for me?

    Ubuntu 14.04 Trusty
    Nautilus
    Samba

    • Hello are you getting any solution for your problem, because i am also suffering with this problem. Plz let me know if your have any solution.

  26. I have been searching everywhere and tried several tutorial. None of that work. Until I read this article then the problem get solved. I’m using Ubuntu 16.04 by the way.

  27. Hey guys, there is one step missing in the tutorial. If you are installing this for the first time, after you launched the samba and key in the administrative password, nothing will appear. You need to create a blank file in order for the GUI tool to work. Open the terminal (Ctrl+Alt+T) >> sudo vim /etc/libuser.conf >> Don’t add anything, just save it as empty file.

  28. Any way to get it to work on 16.04 LTS

  29. Sorry. Bug info here
    http://askubuntu.com/questions/613936/system-config-samba-not-opening-in-ubuntu-14-10-15-04

    It will run (open) in 16.04LTS if you do from terminal:
    gksu system-config-samba

  30. I gwet this:

    alan@Beastie:~$ gksu system-config-samba
    mainWindow.MainWindow(debug_flag)
    File “/usr/share/system-config-samba/mainWindow.py”, line 121, in __init__
    self.basic_preferences_win = basicPreferencesWin.BasicPreferencesWin(self, self.xml, self.samba_data, self.samba_backend, self.main_window)
    File “/usr/share/system-config-samba/basicPreferencesWin.py”, line 97, in __init__
    self.admin = libuser.admin()
    SystemError: could not open configuration file `/etc/libuser.conf’: No such file or directory
    alan@Beastie:~$

    when trying to run gksu from terminal!