• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Samba Domain Administrator SSH

Hallo ,
ich hab ein kleines Problem mit meinem samba Server. Wenn ich mich über ssh mit dem Server verbinde 'ssh root@192.168.1.100' bin ich nicht root sondern der
whoami-->'MYDOMAIN\administrator'. Kann mir jemad sagen woran es liegen könnte?
SLES 11 SP4
Sernet samba 4.6

Danke
 

marce

Guru
vermutlich sowas wie https://www.linuxquestions.org/questions/linux-enterprise-47/logging-in-via-ssh-while-authenticating-against-active-directory-618885/
 

stka

Guru
Da meine Glaskugel leider kaputt ist solltest du uns folgende Infos geben:
- Inhalt der smb.conf
- Inhalt der krb5.conf
-Inhalt der nsswitch.conf
- Den output von "getent passwd administrator"
 
OP
M

MrOverload

Newbie
Danke für die antwort hier die Glasskugel

Smb.conf

Code:
# Global parameters
[global]

        bind interfaces only = yes
        interfaces = lo bond0

        admin users = root
        workgroup = ITS
        realm = ITS.AAL.DE
        netbios name = ITSALLSRV1
        server role = active directory domain controller
        dns forwarder = 192.127.255.130
        server services = rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbind, ntp_signd, kcc, dnsupdate, dns, s3fs
        dcerpc endpoint servers, wkssvc, rpcecho, samr, netlogon, lsarpc, spoolss, drsuapi, dssetup, unixinfo, browser, eventlog6, backupkey, dnsserver, winreg, srvsvc
        idmap_ldb:use rfc2307 = no
        debug level = 1
        template shell = /bin/bash
        #username map = /etc/samba/user.map
        #force user = root

[homes]
        comment = Home Directories
        browseable = no
        writable = yes

[netlogon]
        path = /var/lib/samba/sysvol/its.all.de/scripts
        read only = no

[sysvol]
        path = /var/lib/samba/sysvol
        read only = no

[erstdaten]
        comment = Freigabe fuer Erstdaten
        path = /u10/erstdaten
        create mode = 0774
        directory mode = 0777
        writeable = yes
        browsable = yes
        inherit acls = yes
        write list = @Benutzer_ITSB, @Benutzer_IT

[its]
        comment = Freigabe fuer Erstdaten
        path = /u10/its
        create mode = 0774
        directory mode = 0777
        writeable = yes
        browsable = yes
"/etc/samba/smb.conf" 75L, 1595C


krb5.conf

Code:
[libdefaults]
        default_realm = ITS.ALL.DE
        dns_lookup_realm = false
        dns_lookup_kdc = true


nsswitch.conf

Code:
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       compat                  Use compatibility setup
#       nisplus                 Use NIS+ (NIS version 3)
#       nis                     Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       [NOTFOUND=return]       Stop searching if not found so far
#
# For more information, please read the nsswitch.conf.5 manual page.
#

# passwd: files nis
# shadow: files nis
# group:  files nis

passwd: compat files ldap winbind
group:  compat files ldap winbind

hosts:          files dns
networks:       files dns

services:       files
protocols:      files
rpc:            files
ethers:         files
netmasks:       files
netgroup:       files nis
publickey:      files

bootparams:     files
automount:      files nis
aliases:        files


~                                                                                                                                                                                             
~                                                                                                                                                                                             
~                                                                                                                                                                                             
"/etc/nsswitch.conf" 47L, 1305C



Code:
itsaalsrv1:/etc/init.d # whoami
ITS\administrator
You have new mail in /var/mail/root
itsallpsrv1:/etc/init.d # getent passwd administrator
ITS\administrator:*:0:100::/home/ITS/administrator:/bin/bash
itsallsrv1:/etc/init.d #
 

stka

Guru
Oh ha,
Ein Domaincontroller ist ein Domaincontroller ist ein Domaincontroller. Der DC sollte nie als Fileserver verwendet werden, das ist der erste große Fehler. Grund ist der, dass das ID-Mapping auf einem DC immer anders ist als auf allen anderen Samba-Systemen.
Dann würde mich mal interessieren, wie du an diese Parameter im [global] gekommen bist. So sieht keine smb.conf aus die beim Provisioning erstellt wird. Viele Anleitung zur Einrichtung eines Samba-DCs im netzt sind entweder uralt oder einfach falsch. Einfach ein "samba-tool domain provision" und der [global]-Teil der smb.conf ist fertig, besonders wenn der interne DNS-Server zum Einsatz kommen soll.
Der Parameter "admin users = root" ist hier völlig Sinnlos den siehe manpage zur smb.conf:
This is a list of users who will be granted administrative privileges on the share. This means that they will do all file operations as the super-user (root).
You should use this option very carefully, as any user in this list will be able to do anything they like on the share, irrespective of file permissions.

Macht also nur dann Sinn, wenn ein Windows-Benutzer hier eingetragen wird der Adminrechte (in diesem Fall) an allen Freigaben erhalten soll. GEFÄHRLICH!!

Wie du die Freigaben eingerichtet hast ist für mich absolut unverständlich und falsch. So sollte eine Freigabe aussehen:
Code:
[daten]
	comment = Daten 
	path = /daten/
	read only = No 
	store dos attributes = yes
	map acl inherit = yes
	vfs objects = acl_xattr
	browsable = no

Alle Berechtigungen werden anschließend komplett von Windows aus vergeben. Auf der Linux-Seite passiert da nichts.

Nun zu deiner nsswitch.conf. Woher hast du denn diese Information:
passwd: compat files ldap winbind
group: compat files ldap winbind

Das kann nicht klappen das muss so aussehen:
passwd: compat winbind
group: compat winbind

Das sind zwar die gröbsten und fettesten Fehler, aber keiner führt zu dem Verhalten. Ich habe mal alle Fehler von dir übernommen in einen Test-DC ich konnte das Verhalten nicht erzeugen. Eins kann es noch sein, hast du die Datei "/etc/samba/user.map" noch? Was steht da drin. Lösch die mal.

Ich kann dir nur folgendes empfehlen:
- Setze den DC neu auf ohne Schnick Schnack, nur das Provisioning, lass alles so wie es ist.
- Deine Daten packst du auf einen Samba-Fileserver und machst den zum Member.
- Auf dem FS erzeugst du die Freigaben korrekt.
- Denk an das ID-Mapping auf dem FS, dass das passt.

Ich hoffe nur du willst das Ding so wie es ist nicht produktiv in einem Unternehmen einsetzen. So ist das Ding eine große Sicherheitslücke
 
OP
M

MrOverload

Newbie
Danke Für die schnelle Antwort ! ich habs mitlerweille gelöst es war ein Fehlerhafter rechner in der Domäne mit drin der das Laufwerk als Administrator gemountet hatte. Und ja ist nur ein Testsystem:)
 
Oben