Samba Standalone Server: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Linkai.zhang (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
 
(13 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
=Install=
[[Kategorie:Samba]]
*apt-get install samba
[[Kategorie:SMB]]
=User Managment=
=Installation=
==Systemuser anlegen==
* '''apt install samba smbclient -y'''
jeder User muss im System auch angelegt werden
*useradd -m xinux
==Fügt den Benutzer hinzu==
*sudo smbpasswd -a xinux
=Vorbereitung=
Wir legen ein Gruppe, ein Verzeichnis an und ändern Rechte=
*groupadd share-user
*mkdir /media/share
*chgrp share-user /media/share
*chmod 775 /media/share
*gpasswd -a xinux share-user


=config=
=config=
* Sicherheitskopie erstellen
* '''cp -v ''/etc/samba/smb.conf''{,.orig}'''
==/etc/samba/smb.conf==
==/etc/samba/smb.conf==
*[[smb.conf.minimal]]
*[[smb.conf.minimal]]
*[[smb.conf.home]]
*[[smb.conf.home]]
*[[smb.conf.diverse]]


==testen der config==
==testen der config==
===einfach===
===einfach===
*testparm
*testparm
Maximale Anzahl gleichzeitig geöffneter Dateien erhöhen
*ulimit -n 16384
*echo "* -  nofile    16384" > /etc/security/limits.conf
===ausführlich===
===ausführlich===
*testparm -v
*testparm -v


==starten von samba==
==starten von samba==
*systemctl start nmbd
*systemctl start smbd  
*systemctl start smbd  
==stoppen von samba==
==stoppen von samba==
*systemctl stop nmbd
*systemctl stop smbd
*systemctl stop smbd
==restarten von samba==
==restarten von samba==
*systemctl restart nmbd
*systemctl restart smbd
*systemctl restart smbd
==Welche Ports sind offen==
*netstat -lntup | grep smbd
=testen des samba servers=
=testen des samba servers=
==anonmym==
==anonmym==
Zeile 65: Zeile 59:
*http://wiki.ubuntuusers.de/Samba_Server/smb.conf
*http://wiki.ubuntuusers.de/Samba_Server/smb.conf
*http://wiki.ubuntuusers.de/Samba_Server_PDC
*http://wiki.ubuntuusers.de/Samba_Server_PDC
*https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Standalone_Server

Aktuelle Version vom 25. August 2024, 17:25 Uhr

Installation

  • apt install samba smbclient -y

config

  • Sicherheitskopie erstellen
  • cp -v /etc/samba/smb.conf{,.orig}

/etc/samba/smb.conf

testen der config

einfach

  • testparm

Maximale Anzahl gleichzeitig geöffneter Dateien erhöhen

  • ulimit -n 16384
  • echo "* - nofile 16384" > /etc/security/limits.conf

ausführlich

  • testparm -v

starten von samba

  • systemctl start smbd

stoppen von samba

  • systemctl stop smbd

restarten von samba

  • systemctl restart smbd

Welche Ports sind offen

  • netstat -lntup | grep smbd

testen des samba servers

anonmym

  • smbclient -U% -L localhost

user

  • smbclient -U <username%password> -L localhost

Zugriff

ftp ähnlich mit smbclient

  • smbclient -U xinux%suxer //samba-server/share
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-0.54.2-3282-SUSE-CODE11-x86_64]
 smb: \> ls
  .                                   D        0  Wed Nov  5 14:55:25 2014
  ..                                  D        0  Sun Nov  2 14:25:17 2014
  misc                                D        0  Wed Nov  5 15:07:39 2014
  isos                                D        0  Sun Nov  2 14:38:01 2014

		36537 blocks of size 4194304. 31888 blocks available
 smb: \> 

mounten

  • mount -t cifs -o username=xinux,password=suxer //samba-server/share /mnt/public

Eintrag in der /etc/fstab

//pc100/share  /mnt/share cifs  username=xinux,passwd=suxer 0 0

Links