Samba (SMB) is een protocol waar mee linux pc's kunnen netwerken met linux, mac en windows pc's
Samba : Netwerken met windows, mac en linux
In Linux Mint 18, tijdens het installeren van samba met Synaptic Packet Manager, kom je deze tekst tegen :
"Samba is an implementation of the SMB/CIFS protocol for Unix systems,
providing support for cross-platform file and printer sharing with
Microsoft Windows, OS X, and other Unix systems. Samba can also function
as an NT4-style domain controller, and can integrate with both NT4 domains
and Active Directory realms as a member server."
Samba lijkt dus overweg te kunnen met de verschillende bestandsrechten in de verschilllende bestureings systemen !?
Zie meer hierover oa op :
https://www.samba.org/samba/docs/using_samba/ch08.html
Lees hierin de paragraaf met "Windows NT/2000/XP ACLs" met daarin :
"Windows ... has a file-protection system that is essentially no protection at all."
Latest Samba documentation is on wiki : https://wiki.samba.org/index.php/Main_Page
Verderop staan allerlei internet pagina's gelinkt.
Deze twee hier zijn toch wel de ! Samba handleidingen
https://www.samba.org/samba/docs/using_samba/toc.html
https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection
Zie ook ACL - Access Control List
Inrichten is met goede handleiding goed te doen. Zie hieronder.
Wat is Samba (samba.org, engels)
https://www.samba.org/samba/GUI/
http://www.computerhope.com/jargon/s/samba.htm
Setting up windows user access to linux system using Samba
https://www.samba.org : TroubleShooting Samba
Zie de meeste samba handleidingen
https://help.ubuntu.com/community/Samba/SambaClientGuide
tool : Gadmin
opstarter vanuit het menu :
su-to-root -X -c /usr/sbin/gadmin-samba
Te installeren met
gadmin-samba
Samba Netwerk gebruiken
In de Linux bestanden bladeraar (Nemo) blader je naar- Netwerk - Windows Netwerk. Als daar pc's of wat ook zichtbaar zijn,
dan draait er iets a la Samba. Denk ik (>:-)
In de windows verkenner geldt iets vergelijkbaars. TBD : Welk protocol draait daar ? Het windows thuisnetwerk met WORKGROUP !?
Windows Netwerk = Samba Protocol / Netwerk.
Wat als je alleen Linux pc's met elkaar wilt laten netwerken, al dan niet met een NAS ?
Dan krijg je bij deze mijn complimenten. Linux is netwerk kampioen.
Het Linux / Unix netwerk heet NFS : Network FIle System
ZIe Netwerk - Linux x Linux met NFS
Maar het moet toch SAMBA zijn ? Lets dance :
Weet wat je wilt :
bestanden op een centrale plek beschikbaar maken voor alle andere pc's in huis
centrale plek is een pc, of een NAS, die het Samba protocol aan biedt.
Nas laat ik verder buiten beschouwing hier. ZIe mn NAS pagina.
bepaal welke gebruikers je in je netwerk hebt
bepaal welke gebruikers wat mogen kijken en wat ze mogen wijzigen
Bouw je kennis op voordat je begint
Lees je goed in, en zoek op internet en youtube naar uitleg en demonstraties
Hieronder vindt je links naar dit soort info.
Zorg dat pc's en router beschikbaar zijn
Stappenplan
Configuratie van de router
Inrichten van de server pc
Inirichten van de gebruikers pc's / laptops etc.
onder Linux
onder windows 7
onder windows hoger dan 7 (heb ik niet, dus daarbij heb ik geen verhaal)
https://www.samba.org/samba/docs/using_samba/ch06.html
Ubuntu doc : How to create a samba share ? in de terminal !
http://wiki.linuxmintnl.nl/index.php/Samba#Standaard_instellingen
https://nl.wikibooks.org/wiki/Linux_Systeembeheer/Bestanden_en_printers_delen
http://www.tldp.org/HOWTO/SMB-HOWTO-8.html
https://www.dvdheiden.nl/nl/2012/10/11/samba-installeren-en-configureren/
https://nl.wikibooks.org/wiki/Linux_Systeembeheer/Bestanden_en_printers_delen#Installatie
On youtube :
Windows 7 pc instellen
Samba server
Installeer benodigde software
samba
system-config-samba
# apt-get insatll samba system-config-samba
# apt-get install samba fuse gvfs-backends
samba (als het nog niet standaard geinstalleerd is, in Mint wordt Samba standaard geinstalleerd)
samba fuse gvfs-backends
gigolo : gui voor client pc. Niet nodig !? Helpt wel.
samba config tool gui :
system-config-samba :
voor het beheren van samba users, shares, etc
bij mijn installatie deed ie het niet.
toen in root terminal opgestart met : # system-config-samba
Errors : File /etc/libuser.conf bestaat niet.
File aangemaakt met : # touch /etc/libuser.conf
Toen deed ie het wel >:-)
Ubuntu doc : How to create a samba share ? in de terminal !
http://superuser.com/questions/482454/how-to-cd-into-smb-user100-100-100-100-from-terminal
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Root rechten nodig
de meeste commando's hieronder moeten uitgevoerd worden door user root
in de standaard mint configuratie begin je de commando's met sudo ervoor.
Hieronder heb ik dat sudo er nogal eens niet bijgezet / er uitgehaald.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Install Samba
apt-get update
apt-get install samba
apt-get install smbclient
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Users / gebruikers
Maak alle linux gebruikers aan op de pc's in het netwerk
En diezelfde users maak je ook bekend als samba user
Het is handig om ze in linux en in samba het zelfde paswoord te geven
Linux users aanmaken :
useradd USERNAME
en dit komt dan in /etc/passwd terecht.
er zijn meer manieren om linux users bij te maken.
Samba users aanmaken :
smbpasswd -a <user_name>
stored in /etc/samba/smbusers
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Shared directory
Create a directory to be shared
mkdir /exports/sambashare/
chown jijzelf.jouwachternaam /exports/sambashare
chmod 777 /exports/sambashare
Dit is omdat je that your user must have permission to write and edit the folder you want to share.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
samba config file
/etc/samba/smb.conf
Make a safe backup copy of the original smb.conf
cd /etc/samba
cp smb.conf smb.conf_2016_1115 (aanpassen naar de actueele datum !)
Edit the file "/etc/samba/smb.conf"
Note: The default user group of samba is "WORKGROUP".
Graag veranderen in iets van jezelf, maar dan wel op al je pc's het zelfde
workgroup = linuxzob
In samba kun je de boel type user of type share instellen. Zie smb.conf
Dit voorbeeld gaat uit van type user, want daardoor moet je op een share inloggen
en staat die dus niet open voor eenieder
security = user
add the directory's to share to the very end of the file:
in dit formaat :
[Samba Shared Directory]
path = /exports/sambashare
valid users = jijzelf
read only = no
Tip: There Should be no spaces between the lines,
and there should be a single space both before and after the equal signs.
Na het wijzigen het bestand opslaan
om de configuratie te testen :
eerst samba herstarten
service smbd restart
testparm
commando's nieuwe stijl pus de rest :
systemctl start samba
systemctl restart samba
systemctl stop samba
systemctl status samba
systemctl status -l samba
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Restart samba:
service smbd restart
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
To list your network shares
# List all shares:
smbclient -L //mijncomputer/exports/sambashare -U jijzelf
smbclient -L mijncomputer
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
To access your network share
# connect:
smbclient //mijncomputer/exports/sambashare -U jijzelf
To access your network share use your username (<user_name>) and password
through the path (Linux users) :
"smb://mijncomputer/exports/sambashare/"
or (Windows users) :
"\\mijncomputer\exports\sambashare\"
Note that "mijncomputer" value is passed in smb.conf in "[<mijncomputere>]",
in other words, the share name you entered in "/etc/samba/smb.conf".
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Dit lijkt ook te kunnen :
smbclient -U hans //192.168.21.12/SAMBASHARE
mount -t cifs -o user=hans,iocharset=utf8,noperm //192.168.21.12/SAMBASHARE /mnt/sambashares/SAMBASHARE
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Tot zover deze voorbeeld Samba oefening
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Software installeren
Volgt
Router setup
Volgt
Firewall settings
Voor alleen je lokale thuisnetwerk hoef je je router niet open te zetten. Of wel ?
Probeer het maar. Hier onder staat hoe.
Voeg samba toe aan je firewall, zowel op de server als op de client pc's, met :
# ufw allow Samba
# ufw enable
Firewall uitzetten kan met :
# ufw disable
Geef je PC's allemaal een vast IP nummer. Ook fijn voor je Linux NFS netwerk
De directories op de pc die van over het netwerk gebruikt mogen gaan worden
/sambaserver/
/sambaserver/fotoos/
/sambaserver/hans
Met de bestandenbladeraar Nemo (standaard in Mint 18) kunnen de shared directories ingesteld worden.
als je root rechten hebt.
start nemo als root, in de terminal
standaard werkwijze in Mint is : sudo nemo &
nemo kan hierdoor alle bestanden en directories aanpassen en deleten. Oppassen dus.
Gebruikers aanmaken in Linux en ! in Samba
in Linux : met het Gebruikers en Groepen tool in het menu, of op de commandline met : # adduser
in Samba, met een Samba config tool (TBD, system-config-samba) of op de commandline met : # smbclient
Alle Samba configuratie komt terecht in o.a. onderstaande files.
Te bekijken en aan te passen (als je weet wat je doet) in een tekst editor (wijzigen alleen met root rechten)
/etc/samba/smb.conf
/etc/samba/smbusers
Configuratie testen in de terminal met : # testparm
Samba users aanmaken in de terminal met : # smbclient
Linux users aanmaken in de terminal met : # adduser
Samba Server start / stop / restart
met pc aan/uit, of in de terminal met :
# /etc/init.d/samba start
# /etc/init.d/samba stop
# /etc/init.d/samba restart
En hier wordt uitgelegd dat restarten na het aanpassen van /etc/samba/smb.conf niet eens hoeft >;-) :
https://www.samba.org/samba/docs/using_samba/ch06.html
Verander in elke client in /etc/samba/smb.conf de naar WORKGROUP in een van jezelf, in mijn geval : linuxzob
Open in bestanden bladeraar Nemo het netwerk, links onderaan, klik door naar het windows netwerk en als het goed is kom je zo bij je Samba Server.
Ergens zit een tooltje om je Samba server met de hand in te richten.
Belangrijk daarbij is : het IP nr van de server, en protocol = windows netwerk
Als niet, dan start Gigolo op, en maak daar een bookmark voor je Server.
Vul die netjes in met IP adres van je server. Het betref een windows netwerk.
Als je dit goed doet, en je klikt op deze bookmark, dan opent je Server in Nemo ! >;-)
Nas - instellingen - Netwerk Services - Windows File Sharing (CIFS) :
Directory mode = "Workgroup" of "Active Directory Domain"
Kies Directory mode = "Workgroup"
Workgroup name : Standaard Windows = WORKGROUP. Maak er iets eigens van, op al je pc's en nassen etc hetzelfde
Zie ook Nas Perikelen
BIj mij werkt het !
Daarom mag ik nou ff ophouden met dit onderwerp.
Meer detail volgt ...