Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


admin_grundlagen:samba

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
admin_grundlagen:samba [2017/04/28 12:47] – [Samba starten] ingo_wichmannadmin_grundlagen:samba [2025/11/07 14:21] (aktuell) – [Minimal-Konfiguration] natureshadow2
Zeile 4: Zeile 4:
 ===== Benötigte Pakete ===== ===== Benötigte Pakete =====
 Debian, Ubuntu:  Debian, Ubuntu: 
-  apt-get install samba smbclient samba-common-bin+  apt install samba smbclient samba-common-bin
 ((neuere Versionen manchmal in [[https://packages.debian.org/jessie/samba|Backports]])) ((neuere Versionen manchmal in [[https://packages.debian.org/jessie/samba|Backports]]))
  
Zeile 13: Zeile 13:
 installieren )) installieren ))
  
-Fedora / Centos :  +Fedora / Centos / RedHat / Rocky :  
-  yum install samba+  dnf install samba samba-client
  
 ===== Minimal-Konfiguration ===== ===== Minimal-Konfiguration =====
 <file txt /etc/samba/smb.conf> <file txt /etc/samba/smb.conf>
-[global]+[global]      # vorgegebene Section für globale Parameter
 … …
   workgroup = kurs   workgroup = kurs
 … …
-[freigabe]+[freigabe]    # frei wählbarer Name für eine einzelne Freigabe
   path = /tmp   path = /tmp
   writable = yes   writable = yes
Zeile 41: Zeile 41:
 ===== Samba starten ===== ===== Samba starten =====
  
-SuSE, Centos (ab 6): +SuSE (ab 14), Centos (ab 7): 
-  chkconfig smb on +  systemctl enable --now smb.service 
-  chkconfig nmb on +  systemctl enable --now nmb.service
-  service smb start +
-  service nmb start+
  
-Debian (bis 7): +Ubuntu (ab 14.04), Debian (ab 8):
-  service samba restart +
- +
-Ubuntu (14.04), Debian (ab 8):+
   service smbd restart   service smbd restart
   service nmbd 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 =====
   smbclient -N -L localhost   smbclient -N -L localhost
   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: 
-''/etc/samba/smb.conf'' : 
-<file> 
-  interfaces = vmnet08 
-  bind interfaces only = yes 
-</file> 
-''/var/log/samba/log.nmbd'' 
-<file> 
-[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> 
-)) 
  
 ==== Samba Freigabe mounten ====   ==== Samba Freigabe mounten ====  
 Pakete: Pakete:
-''cifs-utils'' ( Debian ab 6.0 )+''cifs-utils'' ( Debian (ab 6.0), CentOS (ab 7) )
  
   mkdir /mnt/freigabe   mkdir /mnt/freigabe
   mount -t cifs -o username=xxx,uid=localuser,gid=localgroup //notebook17/freigabe /mnt/freigabe   mount -t cifs -o username=xxx,uid=localuser,gid=localgroup //notebook17/freigabe /mnt/freigabe
  
 +(( Warum sehen die Berechtigungen in der Freigabe anders als im lokalen Verzeichnis aus? https://fosdem.org/2019/schedule/event/smb2_posix_extensions/ ))
  
  
Zeile 102: Zeile 85:
  
 ===== Laufen die Samba Dienste? ===== ===== Laufen die Samba Dienste? =====
-  netstat -tulpn | grep nmbd +  ss -tulpn | grep nmbd 
-  netstat -tulpn | grep smbd+  ss -tulpn | grep smbd
 oder oder
   lsof -ai -c smbd -P   lsof -ai -c smbd -P
   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 143: Zeile 126:
 </file> </file>
  
 +Logmeldungen für eine Verbindung:
 +  smbstatus
 +-> PID der Verbindung raussuchen
 +  smbcontrol $PID debug 3
  
 ===== Auf Netzwerkebene lauschen ===== ===== Auf Netzwerkebene lauschen =====
admin_grundlagen/samba.1493383652.txt.gz · Zuletzt geändert: 2017/04/28 12:47 von ingo_wichmann