Dieser Beitrag beschreibt, wie man eine SAMBA Freigabe erstellt. Diese Freigaben-Art wird für Windows Netzwerke verwendet. Für diese Freigaben-Erstellung brauchen wir also SAMBA, sonst versteht Windows nicht, was der Raspberry ins Netzwerk funkt.
Erst muss man SAMBA installieren:
Dazu nutzten wir erst diese zwei Befehle, die Updaten das System und danach installieren wir Samba.
[box type=“custom“ color=“#81d742″ bg=“#000000″]sudo apt-get update
sudo apt-get install samba-common samba samba-common-bin[/box]
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
#======================= Global Settings =======================[global]## Browsing/Identification #### Deine netzwerk Arbeitsgruppe
workgroup = WORKGROUP# server string is the equivalent of the NT Description field
server string = Samba Server# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no#### Debugging/Accounting ##### This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0
####### Authentication #######
# „security = user“ is always a good idea. This will require a Unix account
# in this server for every user accessing the server.
security = user
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user
#######Share Definitions #######
# Freizugebender Ordner
path = /home/pi/share
# Gast Account yes no
guest ok = yes
# Benutzerkreis einschränken
; valid users = pi
# Schreibzugriff erlauben
; writeable = yes
# Share nicht im Netzwerk zeigen
; browseable = no
# wird zusätzlich zur Freigabe angezeigt
; comment = Freigabe
[/box]
Um denOrdner mit Passwort-Schutz anzulegen, müsst ihr einen Linux-User für jeden Benutzer anlegen. Hiermit kann man schön steuern, wer auf was Freigabe erhält und zugreifen darf.
Zuerst muss der Linux Nutzer angelegt werden.
[box type=“custom“ color=“#81d742″ bg=“#000000″]sudo adduser [name] -gecos „“ -no-create-home -ingroup sambashare -shell /bin/false -disabled-login[/box]
Jetzt noch den User für Samba aktivieren:
[box type=“custom“ color=“#81d742″ bg=“#000000″]sudo smbpasswd -a [name][/box]Nun könnt ihr die Option „guest ok“ aus eurer Freigabe rausnehmen und/oder den Benutzerkreis mit „valid users“ einschränken.