Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung Nächste Überarbeitung Beide Seiten, nächste Überarbeitung | ||
admin_grundlagen:samba [2012/12/14 08:38] ingo_wichmann |
admin_grundlagen:samba [2017/11/17 09:50] ingo_wichmann [Samba Freigabe mounten] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
Vorraussetzung: [[Netzwerk]] | Vorraussetzung: [[Netzwerk]] | ||
- | ====== Einfachstes Beispiel ====== | + | ====== 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-get 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 | zypper install samba samba-client | ||
(( man kann die Pakete unter SuSE auch mit | (( man kann die Pakete unter SuSE auch mit | ||
Zeile 11: | Zeile 13: | ||
installieren )) | installieren )) | ||
- | Fedora / Centos 4: (( optional neuere Versionen von http://de.samba.org/samba/ftp/Binary_Packages/ nehmen )) | + | Fedora / Centos : |
yum install samba | yum install samba | ||
===== 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, CentOS 6: 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 nur Version 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, Centos 6: | + | SuSE, Centos (ab 6): |
chkconfig smb on | chkconfig smb on | ||
chkconfig nmb on | chkconfig nmb on | ||
Zeile 39: | Zeile 47: | ||
service nmb start | service nmb start | ||
- | Debian: | + | Debian (bis 7): |
service samba restart | service samba restart | ||
+ | Ubuntu (ab 14.04), Debian (ab 8): | ||
+ | service smbd restart | ||
+ | service nmbd restart | ||
===== Benutzer anlegen ===== | ===== Benutzer anlegen ===== | ||
useradd -m iw | useradd -m iw | ||
Zeile 49: | Zeile 60: | ||
smbclient -N -L localhost | smbclient -N -L localhost | ||
smbclient //notebook17/freigabe -U iw | smbclient //notebook17/freigabe -U iw | ||
- | mount -t cifs -o user=xxx //notebook17/freigabe /mnt/freigabe | ||
- | |||
(( 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: | (( 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: | ||
''/etc/samba/smb.conf'' : | ''/etc/samba/smb.conf'' : | ||
Zeile 68: | Zeile 77: | ||
</file> | </file> | ||
)) | )) | ||
+ | |||
+ | ==== Samba Freigabe mounten ==== | ||
+ | Pakete: | ||
+ | ''cifs-utils'' ( Debian (ab 6.0), CentOS (ab 7) ) | ||
+ | |||
+ | mkdir /mnt/freigabe | ||
+ | mount -t cifs -o username=xxx,uid=localuser,gid=localgroup //notebook17/freigabe /mnt/freigabe | ||
+ | |||
+ | |||
+ | |||
+ | |||
====== Checkliste ====== | ====== Checkliste ====== | ||
===== Syntax-Check für smb.conf ===== | ===== Syntax-Check für smb.conf ===== | ||
Zeile 118: | Zeile 138: | ||
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 |