Inst samba » History » Version 2
Michael Gunsch, 11/20/2023 02:40 PM
| 1 | 1 | Michael Gunsch | h1. Samba auf Debian installieren |
|---|---|---|---|
| 2 | |||
| 3 | h2. Pakete installieren |
||
| 4 | |||
| 5 | <pre> |
||
| 6 | sudo apt install samba smbclient cifs-utils |
||
| 7 | </pre> |
||
| 8 | |||
| 9 | 2 | Michael Gunsch | h3. Benutzer anlegen |
| 10 | 1 | Michael Gunsch | |
| 11 | 2 | Michael Gunsch | <pre> |
| 12 | sudo useradd -M -s /sbin/nologin smbuser |
||
| 13 | </pre> |
||
| 14 | |||
| 15 | h3. Benutzer zur Gruppe @sambashare@ hinzufügen |
||
| 16 | |||
| 17 | <pre> |
||
| 18 | sudo usermod -aG sambashare smbuser |
||
| 19 | </pre> |
||
| 20 | |||
| 21 | h3. Gruppenzugehörigkeit und Rechte auf geteiltem Verzeichnis anpassen |
||
| 22 | |||
| 23 | <pre> |
||
| 24 | sudo chgrp -R sambashare /srv/sambashare/ |
||
| 25 | sudo chmod 2770 /srv/sambashare/XY |
||
| 26 | </pre> |
||
| 27 | |||
| 28 | h2. Konfiguration |
||
| 29 | |||
| 30 | Die zentrale Konfigurationsdatei ist @/etc/samba/smb.conf@. |
||
| 31 | |||
| 32 | 1 | Michael Gunsch | Mit @sudo testparm@ wird die Konfiguration geprüft und sie kann zusammengefasst ausgegeben werden: |
| 33 | |||
| 34 | <pre> |
||
| 35 | Load smb config files from /etc/samba/smb.conf |
||
| 36 | Loaded services file OK. |
||
| 37 | Weak crypto is allowed |
||
| 38 | Server role: ROLE_STANDALONE |
||
| 39 | |||
| 40 | Press enter to see a dump of your service definitions |
||
| 41 | |||
| 42 | # Global parameters |
||
| 43 | [global] |
||
| 44 | log file = /var/log/samba/log.%m |
||
| 45 | logging = file |
||
| 46 | map to guest = Bad User |
||
| 47 | max log size = 1000 |
||
| 48 | obey pam restrictions = Yes |
||
| 49 | pam password change = Yes |
||
| 50 | panic action = /usr/share/samba/panic-action %d |
||
| 51 | passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . |
||
| 52 | passwd program = /usr/bin/passwd %u |
||
| 53 | server role = standalone server |
||
| 54 | unix password sync = Yes |
||
| 55 | usershare allow guests = Yes |
||
| 56 | workgroup = WORKGROUP |
||
| 57 | idmap config * : backend = tdb |
||
| 58 | |||
| 59 | |||
| 60 | [homes] |
||
| 61 | browseable = No |
||
| 62 | comment = Home Directories |
||
| 63 | create mask = 0700 |
||
| 64 | directory mask = 0700 |
||
| 65 | valid users = %S |
||
| 66 | |||
| 67 | |||
| 68 | [private] |
||
| 69 | comment = Netzlaufwerk XY |
||
| 70 | force create mode = 0770 |
||
| 71 | force directory mode = 0770 |
||
| 72 | inherit permissions = Yes |
||
| 73 | path = /srv/sambashare/XY |
||
| 74 | read only = No |
||
| 75 | valid users = @sambashare |
||
| 76 | </pre> |