← Alle Anleitungen
Samba file sharing on Ubuntu
Samba implements the SMB/CIFS protocol, letting a Linux server share folders that appear as normal network drives to Windows, MacOS, and other Linux machines.
Zielsystem: Ubuntu 22.04 LTS / 24.04 LTSfile-sharingSMBnetworkingOffizielle Website ↗Offizielle Dokumentation ↗
Diese Anleitung basiert auf der offiziellen Dokumentation von Samba file sharing on Ubuntu, oben verlinkt — überprüfe dort immer die genauen Paket-/Versionsnamen, bevor du diese Befehle auf einem Produktionsserver ausführst, da sich Distributions- und Projektversionen mit der Zeit ändern.
1Install Samba
sudo apt updatesudo apt install -y samba2Define a shared folder
Add a new section to smb.conf naming the share and pointing it at a real directory.
sudo mkdir -p /srv/samba/sharedsudo chmod 2775 /srv/samba/sharedsudo nano /etc/samba/smb.confAdd at the bottom of smb.conf: [Shared] path = /srv/samba/shared browseable = yes read only = no guest ok = no valid users = @sambashare
3Create a Samba user and restart the service
sudo groupadd sambasharesudo usermod -aG sambashare $USERsudo smbpasswd -a $USERsudo systemctl restart smbd4Connect from a client
On Windows, map a network drive to \\server-ip\Shared; on MacOS, use Finder > Go > Connect to Server with smb://server-ip/Shared.