Samba
Installation
apt install samba cifs-utils samba-client libpam-smbpass
Dienste
- nmbd
- smbd
Samba Benutzer anlegen
sudo usermod -aG sambashare adam
smbpasswd -a jonny
# Auflisten der Benutzer:
pdbedit -w -L
PAM benutzen:
- /etc/samba/smb.conf
[global] ... username map = /etc/samba/my_pam_users.txt
- /etc/samba/my_pam_users.txt
linuxuser1 = jonny linuxuser2 = adam
Konfiguration
Mounten
//sambaserver/freigabe /mnt/mountpunkt cifs user=username,password=passwort,uid=502,gid=500
mount -t cifs //server/freigabe[Verzeichnis] Mountpunkt/ -o { username=Benutzername,password=Paswort | credentials=/Pfad/Zu/Datei }
Freigabe erstellen
- /etc/samba/smb.cnf
[Austausch] path = /home/petra public = yes read only = no browseable = yes [Filme] write list = @adm valid users = @einkauf, @einkauf-ro read list = @einkauf-ro inherit owner = yes force group = adm force directory mode = 770 create mask = 664 force create mode = 664 [global] ... workgroup = EXAMPLE
Kommandos
smbclient //nil/petra
testparm
Win-10
net use <Laufwerksbuchstabe>: \\<IP-des-Samba-Servers>\share /user:smbuser <Passwort> net use n: \\nil\petra /user:petra TopSecret