Project

General

Profile

Inst samba » History » Version 3

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