Comments on Samba Server installation on Ubuntu 16.04 LTS
This guide explains the installation and configuration of a Samba server on Ubuntu 16.04 with anonymous and secured Samba shares. Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Samba is freely available, unlike other SMB/CIFS implementations, and allows for interoperability between Linux/Unix servers and Windows-based clients.
35 Comment(s)
Comments
How I upgrade Samba after Instalation?
Just update your system regularly with:
apt-get update
apt-get upgrade
this will install Samba updates as well as all other system updates.
How to create a common share?
i noticed you installed the system-config-samba which i believe it is the gui utility for samba. i did the same but gui keep crashng. any idea?
after deploying the setup i can share the directory but the folder is not accessible in windows(shows folder). It says "you might not have permissions to use this network"
Awesome writeup, pitty you are a rare bread amongst linux users, meaning this is the best guide to SAMBA by a long way!!!
What is the purpose of creating "smbgrp" if the samba installation already creates the group "sambashare"? Why not just use that existing group?
This command did not work at all, (notepad C:\\Windows\System32\drivers\etc\hosts)
These commands did nothing .... (cp -pf /etc/samba/smb.conf /etc/samba/smb.conf.bakcat /dev/null > /etc/samba/smb.conf)
I copied and pasted this in the window......
[global] workgroup = WORKGROUP server string = Samba Server %v netbios name = ubuntu security = user map to guest = bad user dns proxy = no #============================ Share Definitions ============================== [Anonymous] path = /samba/anonymous browsable =yes writable = yes guest ok = yes read only = noforce user = nobodyafter Opening the Samba configuration file with nano had no instructions what to do after that. couldnt save it couldnt add it to file.....I am no closer to having my server set up than i was before i read all this.... obviously i am a newbee and i am frustrated with all the how to stuff on the web with missing steps......
Thanky ou for your report. I just installed the tutorial again to verify it and there are no issues in the tutorial, all commands are working and it results in a fully working samba server. If a command does not return anything on Linux then it means that it worked, if it would not have worked then you would have gotten an error message, so the commands you posted are working file and they did exactly what they should (make a copy of the configuration file and create a new empty file.
"This command did not work at all, (notepad C:\\Windows\System32\drivers\etc\hosts)"
File editors in windows need to be run as Administrator to access/edit the hosts file.
Rightclick on the notepad icon, then click on "Run as Administrator".
Then click on file/open and enter "C:\\Windows\System32\drivers\etc\hosts" should now work.
Correct command is: notepad C:\Windows\System32\drivers\etc\hosts
On Windows 10 you can even press right mousebutton over the startmenu and choose Windows Powershell (Admin) and write the command to there.
First, thank you for the guide. It is very usefull.
But I have a problem, I created the secure samba server. But in windows when I try to use it, windows gives me an error.
"Multiple connections to a server or shared resource by the same user, using more than one user name are not allowed. Disconnect all previous connections to the server or shared resource and try again."
How can I solve this?
Thank you.
Hola a tod@s!!!
Yo tenía Ubuntu 14.04 como servidor y a él se conectan equipos linux con Samba, desde que actualicé a 16.04 estuve viernes 29 Jul, sábado 30 Jul y Lunes 01 Ago. No sé qué fue lo que quedó mal con la configuración porque ya no pude más acceder a las carpetas y ni a las impresoras de Linux desde Windows. Intenté un montón de configuraciones de versiones anteriores de Ubuntu y ninguna me funcionó.
Hasta que encontré este lugar y quedó de nuevo trabajando, cambiando la instrucción (de acuerdo al ejemplo, solo cambiando la ruta de mis carpetas):
chown -R nobody:nogroup /samba/anonymous por chown -R serverlinux:nogroup /MiRed/MisCarpetas
ya que al principio probé con nobody, podía accesar a carpetas y archivos pero no grabar.
Solo me queda reconfigurar las impresoras que aún lo tengo pendiente, por ahora la impresora la tengo instalada en modo compartida en un equipo con Windows, a ver si pueden escribir un pequeño manual para saber cómo configurarlas. Además, la manera de restringir a usuarios a ciertas carpetas es la parte que también explican aqui pero que aun no lo he probado.
Quiero comentar también que en Linux soy novato y esta explicación fue muy entendible a comparación de otros que encontré ne la web.
Muchas gracias.
Hola a tod@s!!
Por alguna razón de un día para otro, me volvió a dar problemas de conexión. Lo que haré ahora es hacer una instalación limpia de Ubuntu 16.04 y a ver si con eso se resuelve, porque lo que hice fue hacer actualización desde versión 14.04 a ésta nueva versión.
Ya les estaré contando, saludos.
El problema que encontré es que se desconecta del wifi sin razón alguna y no la configuración de Samba, al parecer es del mismo administrador del wifi de Ubuntu.
Buscando en internet, encontré que no nada más a mí me está pasando la desconexión y dieron una solución temporal que funciona y es la siguiente:
sudo service network-manager restart (fuente: https://fpkanarias.blogspot.mx/2016/06/una-solucion-para-los-problemas-de-la.html)
De ser posible, hacerlo varias veces hasta que se vuelva a reconectar. A mí, del todo no me conviene ya que tengo un sistema en red y a mis compañeros que se conectan a ella, a cada rato los "bota" del sistema.
Espero y se resuelva pronto esto por parte del equipo de Ubuntu o de plano instalar una versión anterior.
Saludos.
after installing samba in anonymous configuration one major difficulty occured: I was able to create a subfolder from my Windows 10 desktop, but the subfolder does not have write permission and I cannot change the permission in Windows 10. Of course I can change the permissions on the server, but that is not really a good workaraound. What did I d wrong?
What I did wrong was to install Windows 10 ...
As Admin on Windows 10, I was finally able to change permissions on the Anonymous folder and all subfolders. So it works fine.
excuse but I cannot find the link to download the vm image of this tutorial
Upper right corner, below the big red download icon.
After trying the two gui's for configuring samba several times I waited to find time to try the manually config. With your tutorial it was that easy - why didn't I try earlier ;) Thanks!
Thank you - a great help :)
In the anonymous example if I create a new folder I automaticly get:
New Folder
New Folder (2)
New Folder (3)
New Folder (4)
I can drag and drop stuff..
I solved it by adding this to the anonymous share section :
force directory mode = 0775
I also use Windows 10 x64 and Ubuntu 16.04 x32
I can share directory anonymous and create folder, but when I create another sub folder inside the folder, or copying folder that contains files and sub-folders it gives me error permission. what should i do?
"Now you can access the Ubuntu sharing in Windows by entering "\\server1" in the windows search field of the menu or use the network browser of the Windows file explorer to connect to the share."
No I can't, Do I only have to modify the hosts file and nothing else? How do you make the network appear besides your computer on the windows explorer sidebar?? If I run \\server1 I get a path not found error. Definetly there are missing steps here.
I can't get it to work at all accessing other ubuntu 16.04 or windows 10
must be missing steps thank you
Hi Till - many thanks for this tutorial - it's given me a breakthrough after quite some hours struggling to find up to date info
I've implemented your section 2 for the anonymous server and it works fine with two different W10 systems able to see the anonymous folder and to read/write create sub-folders etc - in fact all working normally for my simple home based local network
BUT I've come unstuck when I've tried to use the same approach to work with another physical disk on the Linux/Samba machine. The disk is mounted (/media/a1000) on the linux side and I can do all the things I need. However in W10 while I can see the mounted disk in File Explorer I can't progress beyond there and it gives me an Error about not having permission to access and telling me to contact my network administrator (a nice Catch 22 there as I am the said admin!!)
Have you any advice or "magic sauce" to ease me past this roadblock
cheers from New Zealand
"> /etc/samba/smb.conf" is enough
Thank you very much for your clear tutorial.
I've tried several, and yours is the first one that works flawless with easy and clear steps!
Worked for me, thanks!!
hi,
i must use this to intall # apt-get -f install
but have this error: /var/cache/apt/archives/liboxideqtcor0_1.21.5-0ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
How to fix?
I found it so usefull
Thanks
Thank you, essential and precise. I have done the same configuration but when I work on the server I do not see the Netbio name = UBUNTU, when I run the testparm. When I browse in Win 10 I do not see the server, UBUNTU. I connected the Anonymous and Secured folders to the Win 10 desktop. When I'm on an iMac-Linux workstation I can browse the WORKGROUP, the server, UBUNTU (linux), the 1571G50K server, (woprkstation win10). On the Win10 workstation, 1571g50k, before connecting the UBUNTU server, I could see, in Win10 network resources, the same 1571g50k workstation as a server. Now, on Win10 I can not see neither UBUNTU nor 1571G50K servers.Only 2 differences, apparently, my version of Samba is 4.3.11-Ubuntu and directories are in / home / samba /. Maybe you have an idea of why this thing happens? Thank you again...
Thank you very much, it works like a charm just follow the steps above, working both for shared and secured!!!!
gracias amigo por compartir tus conocimientos me sirvio mucho el tutorial para lo que necesitaba
sigue adelante gente asi necesitamos