LAB Linux in heterogenen Netzen File Server: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 159: Zeile 159:
 
<pre>
 
<pre>
 
[buchhaltung]
 
[buchhaltung]
path = /share/buchhaltung
+
[produktion]
 +
path = /share/produktion
 
hide unreadable = yes
 
hide unreadable = yes
 
force create mode = 0770
 
force create mode = 0770
 
force directory mode = 0770
 
force directory mode = 0770
 +
read only = no
 +
inherit acls = yes
 +
inherit permissions = yes
  
[produktion]
+
[buchhaltung]
path = /share/produktion
+
path = /share/buchhaltung
 
hide unreadable = yes
 
hide unreadable = yes
 
force create mode = 0770
 
force create mode = 0770
 
force directory mode = 0770
 
force directory mode = 0770
 +
read only = no
 +
inherit acls = yes
 +
inherit permissions = yes
 +
 
</pre>
 
</pre>
 +
 
=Auf dem DC=
 
=Auf dem DC=
 
*Gruppe '''buchhaltung''' und '''produktion''' anlegen
 
*Gruppe '''buchhaltung''' und '''produktion''' anlegen

Version vom 7. Oktober 2024, 12:49 Uhr

Ziel

  • Wir wollen einen Filseserver auf Linux aufsetzen
  • Dieser soll als Domain Member agieren.

Aus dem Debian Template einen Klon erstellen

Zuerst noch 2 50GByte Platten anhängen.
  • Name: fileserver
  • Netz: dmz
  • HOSTS: fileserver.lab34.linuggs.de
  • IPv4: 172.26.54.7/24
  • GWv4: 172.26.54.1
  • NSv4: 172.26.54.2
  • DOM: lab34.linuggs.de
  • HOSTS: fileserver.lab34.linuggs.de
  • IPv6: 2a02:24d8:71:3036::7/64
  • GWv6: 2a02:24d8:71:3036::1
  • NSv6: 2a02:24d8:71:3036::2
  • DOM: lab34.linuggs.de

samba4 installieren

  • apt install samba krb5-config krb5-user winbind libpam-winbind libnss-winbind acl

Update der Pam

  • pam-auth-update

Debian-ads1.png

/etc/samba/smb.conf

[global]
  workgroup = lab34
  realm = lab34.linuggs.de
  security = ADS

  log level = 1 winbind:5

  winbind refresh tickets = Yes
  vfs objects = acl_xattr
  map acl inherit = Yes
  store dos attributes = Yes

  winbind use default domain = yes
  winbind nss info = template

  winbind enum users = yes
  winbind enum groups = yes

  idmap config * : backend = tdb
  idmap config * : range = 3000-7999

  idmap config lab34.linuggs.de : backend = rid
  idmap config lab34.linuggs.de : range = 10000-99999

  template homedir = /home/%U
  template shell = /bin/bash

  # Mapping domain Administrator to local root
  username map = /etc/samba/user.map

  kerberos method = dedicated keytab
  dedicated keytab file = /etc/krb5.keytab


/etc/krb5.conf

[libdefaults]
      default_realm = LAB34.LINUGGS.DE
      dns_lookup_realm = true
      dns_lookup_kdc = true

[realms]
      LAB34.LINUGGS.DE = {
            kdc = win2022.lab34.linuggs.de
            admin_server = win2022.lab34.linuggs.de
      }

[domain_realm]
      .lab34.linuggs.de = LAB34.LINUGGS.DE
      lab34.linuggs.de = LAB34.LINUGGS.DE


Initiieren Sie ein Kerberos-Ticket

  • kinit administrator

List

  • klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: administrator@LAB34.LINUGGS.DE 

Valid starting       Expires              Service principal
10/02/2024 10:49:53  10/02/2024 20:49:53  krbtgt/LAB34.LINUGGS.DE@LAB34.LINUGGS.DE
	renew until 10/03/2024 10:49:47

Erstellen Sie eine Kerberos-Keytab-Datei

  • net ads keytab create -U administrator

Treten Sie der AD-Domäne bei

  • net ads join -U administrator

domaine beitreten


root@lang:~# net ads join -U administrator
Enter administrator's password:
Using short domain name -- LINUGGS
Joined 'LANG' to dns domain 'linuggs.lan'



/etc/nsswitch.conf ändern

passwd:         files systemd winbind
group:          files systemd winbind

services neustarten

  • systemctl restart smbd
  • systemctl restart nmbd
  • systemctl restart winbind

ist winbind is "pingbar

  • wbinfo -p
Ping to winbindd succeeded

anzeigen der userliste

  • wbinfo -u
Administrator
Guest
krbtgt

anzeigen der passwd

hier solten nun benutzer aus der ad autauchen
  • getent passwd
 
benutzer03:*:11107:10513::/home/benutzer03:/bin/bash
administrator:*:10500:10513::/home/administrator:/bin/bash
benutzer04:*:11108:10513::/home/benutzer04:/bin/bash
benutzer01:*:11105:10513::/home/benutzer01:/bin/bash
krbtgt:*:10502:10513::/home/krbtgt:/bin/bash
benutzer02:*:11106:10513::/home/benutzer02:/bin/bash
guest:*:10501:10513::/home/guest:/bin/bash
thomas:*:11104:10513::/home/thomas:/bin/bash

ZFS Installation

In der /etc/apt/sources.list contrib hinzufügen.
  • apt update
  • apt install zfsutils-linux
  • reboot

ZFS Mirror und Datasets anlegen

  • zpool create share mirror /dev/sdb /dev/sdc
  • zfs create share/buchhaltung
  • zfs create share/produktion
acls aktivieren
  • zfs set acltype=posixacl share/buchhaltung
  • zfs set acltype=posixacl share/produktion

Shares anlegen

/etc/samba/smb.conf ergänzen

[buchhaltung]
[produktion]
path = /share/produktion
hide unreadable = yes
force create mode = 0770
force directory mode = 0770
read only = no
inherit acls = yes
inherit permissions = yes

[buchhaltung]
path = /share/buchhaltung
hide unreadable = yes
force create mode = 0770
force directory mode = 0770
read only = no
inherit acls = yes
inherit permissions = yes

Auf dem DC

  • Gruppe buchhaltung und produktion anlegen
  • Benutzer nach Wahl hinzufügen

Auf dem Fileserver

Rechte setzen
  • setfacl -m g:produktion:rwx /share/produktion
  • setfacl -m g:buchhaltung:rwx /share/buchhaltung

LIBPAM