Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
admin_grundlagen:samba [2012/02/17 08:17] 127.0.0.1 Externe Bearbeitung |
admin_grundlagen:samba [2024/04/18 12:41] (aktuell) |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Einfachstes Beispiel ====== | + | Vorraussetzung: [[Netzwerk]] |
+ | |||
+ | ====== Einfacher Dateiserver ====== | ||
===== Benötigte Pakete ===== | ===== Benötigte Pakete ===== | ||
- | Debian: (( optional Pakete wie in http://de.samba.org/samba/ftp/Binary_Packages/Debian/README.txt beschrieben von samba.org nehmen )) | + | Debian, Ubuntu: |
- | aptitude install samba smbclient samba-common-bin | + | apt install samba smbclient samba-common-bin |
- | SuSE: (( optional neuere Versionen von http://de.samba.org/samba/ftp/Binary_Packages/ nehmen )) | + | ((neuere Versionen manchmal in [[https://packages.debian.org/jessie/samba|Backports]])) |
+ | |||
+ | SuSE: | ||
+ | zypper install samba samba-client | ||
+ | (( man kann die Pakete unter SuSE auch mit | ||
yast -i samba samba-client | yast -i samba samba-client | ||
- | Fedora / Centos 4: (( optional neuere Versionen von http://de.samba.org/samba/ftp/Binary_Packages/ nehmen )) | + | installieren )) |
- | yum install samba | + | |
+ | Fedora / Centos : | ||
+ | yum install samba samba-client | ||
===== Minimal-Konfiguration ===== | ===== Minimal-Konfiguration ===== | ||
- | ''/etc/samba/smb.conf'': | + | <file txt /etc/samba/smb.conf> |
- | <file> | + | |
[global] | [global] | ||
+ | … | ||
workgroup = kurs | workgroup = kurs | ||
- | passdb backend = tdbsam | + | … |
[freigabe] | [freigabe] | ||
path = /tmp | path = /tmp | ||
writable = yes | writable = yes | ||
+ | … | ||
</file> | </file> | ||
- | Überprüfen: (( Debian 6.0, openSuSE 11.4: Fehlermeldung ''rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)'' kann man ignorieren, siehe http://bugs.debian.org/608624 )) | + | Überprüfen: (( Debian 6.0, openSuSE 11.4, CentOS 6: Fehlermeldung ''rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)'' kann man ignorieren, siehe http://bugs.debian.org/608624 )) |
+ | |||
+ | ((Den Fehler | ||
+ | ''ERROR: pid directory /var/run/samba does not exist'' | ||
+ | kann man auch ignorieren. Das fehlende Verzeichnis wird beim ersten Start von Samba angelegt. | ||
+ | )) | ||
testparm | testparm | ||
+ | (( Mit Anzeige der default settings | ||
+ | testparm -v | ||
+ | )) | ||
===== Samba starten ===== | ===== Samba starten ===== | ||
- | openSuSE 11.4 : ((Bug in openSuSE 11.4: https://bugzilla.novell.com/show_bug.cgi?id=666450 http://en.opensuse.org/openSUSE:Most_annoying_bugs_11.4)) | ||
- | /etc/init.d/boot.apparmor stop | ||
- | SuSE: | + | SuSE (ab 14), Centos (ab 7): |
- | chkconfig smb on | + | systemctl enable --now smb.service |
- | chkconfig nmb on | + | systemctl enable --now nmb.service |
- | /etc/init.d/smb start | + | |
- | /etc/init.d/nmb start | + | |
- | + | ||
- | Fedora / Centos: | + | |
- | chkconfig smb on | + | |
- | /etc/init.d/smb start | + | |
- | + | ||
- | Debian: | + | |
- | /etc/init.d/samba restart | + | |
+ | Ubuntu (ab 14.04), Debian (ab 8): | ||
+ | service smbd restart | ||
+ | service nmbd restart | ||
===== Benutzer anlegen ===== | ===== Benutzer anlegen ===== | ||
+ | Erst Unix-Nutzer: | ||
useradd -m iw | useradd -m iw | ||
+ | |||
+ | Dann Windows-Attribute hinzufügen: | ||
smbpasswd -a iw | smbpasswd -a iw | ||
+ | oder | ||
+ | pdbedit -a -u iw | ||
===== Testen ===== | ===== Testen ===== | ||
Zeile 48: | Zeile 61: | ||
smbclient //notebook17/freigabe -U iw | smbclient //notebook17/freigabe -U iw | ||
- | (( Unter Debian 6.0 und vmware player 4.0.2 tauchten Probleme beim Zugriff von der VM mit Windows XP auf den Samba Server auf. Durch folgenden Eintrag konnten wir den Fehler reproduzieren: | + | ==== Samba Freigabe mounten ==== |
- | ''/etc/samba/smb.conf'' : | + | Pakete: |
- | <file> | + | ''cifs-utils'' ( Debian (ab 6.0), CentOS (ab 7) ) |
- | interfaces = vmnet08 | + | |
- | bind interfaces only = yes | + | mkdir /mnt/freigabe |
- | </file> | + | mount -t cifs -o username=xxx,uid=localuser,gid=localgroup //notebook17/freigabe /mnt/freigabe |
- | ''/var/log/samba/log.nmbd'' | + | |
- | <file> | + | (( Warum sehen die Berechtigungen in der Freigabe anders als im lokalen Verzeichnis aus? https://fosdem.org/2019/schedule/event/smb2_posix_extensions/ )) |
- | [2012/02/17 09:10:26.164668, 0] lib/interface.c:542(load_interfaces) | + | |
- | WARNING: no network interfaces found | + | |
- | </file> | + | |
- | Scheinbar kommt Samba mit den VMware Interfaces nicht klar. Lösung: | + | |
- | <file> | + | |
- | interfaces = 192.168.197.0/24 | + | |
- | bind interfaces only = yes | + | |
- | </file> | + | |
- | )) | + | |
====== Checkliste ====== | ====== Checkliste ====== | ||
===== Syntax-Check für smb.conf ===== | ===== Syntax-Check für smb.conf ===== | ||
Zeile 85: | Zeile 91: | ||
lsof -ai -c nmbd -P | lsof -ai -c nmbd -P | ||
===== Windows Browsing ===== | ===== Windows Browsing ===== | ||
- | nmblookup -M arbeitsgruppe | + | nmblookup -M kurs |
===== Existiert ein passender Unix-Account? ===== | ===== Existiert ein passender Unix-Account? ===== | ||
Zeile 115: | Zeile 121: | ||
Logmeldungen besser finden: | Logmeldungen besser finden: | ||
- | ''/etc/samba/smb.conf'': | + | <file txt /etc/samba/smb.conf> |
- | <file> | + | |
[global] | [global] | ||
log file = /var/log/samba/log.%m | log file = /var/log/samba/log.%m |