Samba4 Installation simple: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „=Installation= *apt-get install samba =Konfiguration= ==User anlegen== Um einen samba user anzulegen wird ein user auf dem system benötigt (useradd). Anschli…“)
 
Zeile 39: Zeile 39:
 
   guest ok = yes
 
   guest ok = yes
  
 +
</pre>
 +
 +
=password sync zwischen unix und samba=
 +
In der smb.conf sollten folgende Einträge stehen:
 +
<pre>
 +
  unix password sync = yes
 +
  pam password change = yes
 +
  passwd program = /usr/bin/passwd %u
 +
  passwd chat = *new*password* %n\n *new*password* %n\n *updated*
 +
</pre>
 +
 +
Passwort sync als root geht so nicht. Dafür folgendes script:
 +
<pre>
 +
#!/bin/bash
 +
username=$1
 +
password=$2
 +
echo $username:$password | chpasswd
 +
echo -e "$password\n$password" | /usr/bin/smbpasswd -s -a $username
 
</pre>
 
</pre>

Version vom 31. Oktober 2018, 15:01 Uhr

Installation

  • apt-get install samba

Konfiguration

User anlegen

Um einen samba user anzulegen wird ein user auf dem system benötigt (useradd). Anschließend muss dem gewünschtem user ein samba passwort gegeben werden

  • smbpasswd -a username

privat share

Unter

  • vi /etc/samba/smb.conf

folgende Zeilen einfügen:

[homes]
   comment = Home Directories
   browseable = yes
   read only = no
   create mask = 0700
   directory mask = 0700
   valid users = %S

public share

  • mkdir /var/samba
  • chmod 777 /var/samba/

unter

  • vi /etc/samba/smb.conf

folgende Zeilen einfügen:

[public]
  comment = public anonymous access
  path = /var/samba/
  browsable =yes
  create mask = 0660
  directory mask = 0771
  writable = yes
  guest ok = yes

password sync zwischen unix und samba

In der smb.conf sollten folgende Einträge stehen:

   unix password sync = yes
   pam password change = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *new*password* %n\n *new*password* %n\n *updated*

Passwort sync als root geht so nicht. Dafür folgendes script:

#!/bin/bash
username=$1
password=$2
echo $username:$password | chpasswd
echo -e "$password\n$password" | /usr/bin/smbpasswd -s -a $username