Install Samba server in ubuntu 11.04 & Ubuntu 11.10 Oneiric Ocelot

If you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.

Samba is a free software re-implementation of SMB/CIFS networking protocol, originally developed by Australian Andrew Tridgell. As of version 3, Samba provides file and print services for various Microsoft Windows clients and

can integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a domain member. It can also be part of an Active Directory domain.Samba runs on most Unix and Unix-like systems, such as Linux, Solaris, AIX and the BSD variants, including Apple’s Mac OS X Server (which was added to the Mac OS X client in version 10.2). Samba is standard on nearly all distributions of Linux and is commonly included as a basic system service on other Unix-based operating systems as well. Samba is released under the GNU General Public License. The name Samba comes from SMB (Server Message Block), the name of the standard protocol used by the Microsoft Windows network file system.  (Wikipedia)

Here are some other posts that complete this article :

How do I set permissions to Samba shares?

Share Ubuntu Home Directories using Samba

How to configure Samba using a graphical interface in Ubuntu

Lets  start then,

Install  samba  in  Ubuntu   can be  from Gui tool (Software  center  of  from command  line )

First we have to install sambe server, In  the termina type the command  :

sudo apt-get install samba smbfs

Now we  have  for  example  to  share  this directory  /share

lets make  a  configuration of  the samba  share :

#sudo vi /etc/samba/smb.conf

Look for this :

 # [global] security = USER

And add these lines just bellow security = user see screenshot bellow :

 hosts allow =
 [homes] comment = Home Directories browseable = no writable = yes [share] comment = Unixmen File Server path = /share/ force user = samba force group = samba read only = No hosts allow =

Explain : every  user connected to this samba  server can connect directly to his /home/directory

First  add a user (For example: unixmenuser to  the  system, in the terminal type the command :

#sudo  adduser  unixmenuser
root@unixmen-desktop:~# adduser unixmenuser

Adding user `unixmenuser’ …
Adding new group `unixmenuser’ (1003) …
Adding new user `unixmenuser’ (1003) with group `unixmenuser’ …
Creating home directory `/home/unixmenuser’ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for unixmenuser
Enter the new value, or press ENTER for the default
Full Name []:


now  make  a  samba  password  for  this user    with  :

sudo smbpasswd  -a   unixmenuser


New SMB password:
Retype new SMB password:
Added user unixmenuser.

Now  restart  your  samba  server

sudo /etc/init.d/samba   restart
  • Connect   to  Server  using  windows  share    via

Now if you have another computer with windows machine installed, test if it is working:

In your windows go to :

Start  —->   run    and insert   ip or  hostname


put your  login and  samba password



Enjoy  and  free   free   to  ask  :)

  • Michael

    Been looking around for a bit of help, and was told this site was a good resource.

    I set Samba up in Ubuntu 9.10, the problem I ran into was duplicate logins appearing in the Ubuntu login screen.

    I’m working on a 10.04 box and need to have at least three separate shares – two different test web sites and one document storage ( r/w/e ) for general office access that will also have a centralized scanner saving pdf’s to a specific folder through an SMB connection.

    Can you direct me to a tut on your site that describes how to set up the Samba users and not have the logins show up in the Ubuntu login screen?

  • Micah

    On Windows, once you map a network drive or just connect via the run command; how do you log out to log in as a different user, like if one of your folders has special permissions for a specific UNIX user?

  • just nobody

    just admit, some tasks are easier in wingoz, write click , enable sharing and you`re done, no samba mambo jumbo, have to be half genius to get the share going; ubuntu is great but is it user friendly? some dude said on another forum that sharing folders over network is actually easier on ubuntu than on windows~ that is just a load of crap~ let`s not overrate something that is not really there, just because is ubuntu and it`s free; i like it also and use it on my pc, and i have winxp on my lappy, but , boy, ubuntu was never easier to configure that windows.

  • minimal

    Hey, just nobody, you are damn right. I like ubuntu but when will these ubuntu (linux) guys realize that they need full product … one very intuitive and easy to manage.
    Without it ubuntu (linux) will never come close to windows and mac os ….

  • ngurah

    i have the same problem, does any one here can help?

  • Dusten B.

    @just nobody; From any Linux desktop (GNOME, KDE, whatever) you can right click, and enable sharing. Thats really more difficult than Windows, for you??

    The method explained in this article shows how to do the same thing on the command line, which is helpful for Linux servers that may not have a monitor, keyboard, desktop environment, or X.

  • Roy M.

    I must have messed up. New Installation of 10-04 on ASUS BP5220A and right click on ANY folder does NOT show "Sharing Options". Apache and Avahi both installed. Personal File Sharing activated. Same CD used to install 10-04 on eMachine works fine. Any comments or suggestions to share folders between those to boxes greatly appreciated. Thanks in advance

  • Rik

    [color=red][size=medium]"some tasks are easier in wingoz, write click , enable sharing and you`re done, no samba mambo jumbo"[/size][/color]

    You do the same thing in Linux desktop.

    The samba method just lets you do more advanced stuff.

    Ubuntu is hands down easier than Windows. I install Ubuntu, and all hardware drivers are fully installed (sound, nic, modem, video, firewire, tvcard, monitor, wireless, etc). Never mind the immunity you get from viruses. Do you get that in Windows?

    Also, the cost of Windows may not matter to you – the home user. But what if you have to pay for 1,000 or 10,000 licenses?

  • djedyed

    I am a fascinated newbie to the linux/unix platform. i sometime make typos in editing conf files and somehow i am not able to delete the tpyoed do i correct it and save the file

    Thanks in advance

  • sedraoui

    i think the best area to put questions is the forums . please do it there .

  • Help needed

    For the root number. what shld i put ?

  • Anonymous

    great. very easy and usefull.

  • http://enteryoursiteURL... Hulahula

    very good

  • http://enteryoursiteURL... hinfung

    How to install Eucalyptus system ?

  • Loren41

    My Windows 7 desktop is connected to an unRAID backup server over a local network. I want to add my laptop running Ubuntu 11.04 via Samba so that I can backup my files to the server as well.

    When I explore my home folder I see a folder named "network." If I open that, I see the unRAID folder and a folder called backup. This contains files that I backed up from the Windows machine.

    When I try to configure the program, Deja Dup, to backup my files, I do not see the network or unRaid directories. In Samba I only see a printer share, but nothing for my backup location.

    What should I do?

  • BnoL

    Hi, thank you for the tutorial :). I wonder is there any difference between sharing with Ubuntu-WindowsXP and Ubuntu-Windows7?

  • lolo

    no entendiiiiiiiiiiiiiiiii

  • Tecno

    The restart method "sudo /etc/init.d/samba restart" does not work, now you have to use "sudo service smbd restart"

  • budi s

    how to instal driver at os kubuntu 11.10 ? Thank’s. Good Luck. From Indonesia

  • Doug Leary

    Thank you for taking the time to document this. The only step I don’t understand is where you say, "Connect to Server using windows share via" and then you show a dialog entitled "Connect to Server." What is this dialog and how do you get to it? I can’t find anything in Ubuntu that looks like this.

  • kimme

    To restart tour samba server the command here is wrong, it should be “sudo service smbd restart”

  • Pax

    “sudo service smbd restart” is for debian computers”sudo /etc/init.d/samba   restart” is for redhat and if memory serves me also for Gentoo

  • kimme

     Yeah, and what is Ubuntu based on?

  • kimme

     Yeah, and what is Ubuntu based on?

  • kimme

     Yeah, and what is Ubuntu based on?

  • kimme

     Yeah, and what is Ubuntu based on?

  • Wova

    Hey guys please help me. I have done all necessary settings but I cannot be able to upload stuff or web-files to the root directory because of permissions. How do I grant full access to users or can you recommend any other solution?

  • guest

    sudo restart smbd

  • Pingback: Prism()

  • Pingback: How to configure Samba using a graphical interface in Ubuntu | Terminal Matrix()

  • Pingback: Install Samba server in ubuntu 11.04 & Ubuntu 11.10 Oneiric Ocelot | Network Engineering()

  • Pingback: Samba List Shares Ubuntu | Investing Wealth()