Solaris authenticatie in Active Directory

Windows, Android, iOS, Linux, Chrome OS, ...
Sunreezer
Plus Member
Plus Member
Berichten: 202
Lid geworden op: 29 nov 2007, 19:10

De bedoeling is dus dat ik op een Solaris machine kan inloggen met credentials van gebruikers die in de Active Directory zitten. Ik heb deze procedure gedurende een week op verschillende manieren uitgeprobeerd en heb er enorme lange Google-zoeksessies opzitten en ik kom er maar niet uit.

Installatie Active Directory

Eerst en vooral heb ik de AD voor blabla.be geïnstalleerd op de machine ad01. -> ad01.blabla.be.

Installatie NIS server

Vervolgens heb ik de UNIX attributen toegevoegd aan mijn AD:

“Control Panel” “Ad/Remove Programs”
Selecteer “Active Directory Services” “Details” “Identity Management for Unix”
“Server for NIS”


Maak een Global Security group aan voor de Unix gebruikers

Maak in je Active Directory een Global Security group aan en noem deze voor alle
duidelijkheid “UNIX”. Stel bij de Unix attributen van deze groep het NIS domain in op
blabla.


Aanmaken van de gebruikers in de Active Directory

Voor elke gebruiker die we willen laten inloggen op onze Solaris machine moet er dus
een account bestaan in de Active Directory. Omdat het hier om Unix gebruikers gaat
moeten we dus de Unix attributen aanpassen.

Ga hiervoor naar de eigenschappen van je aangemaakte gebruikers accounts en klik op
de “UNIX Attributes” tab. Bij NIS domain kies je voor blabla en als Primary group kies je de
Global Security group die we zonet aangemaakt hebben.


Toevoegen van de gebruikers aan de Global Security group

Nu moeten we de net aangemaakte NIS gebruikers nog toevoegen aan de Global
Security group. Ga hiervoor naar de eigenschappen van je group en ga naar de UNIX
Attributes tab. Als je nu op Add klikt kan je de beschikbare NIS gebruikers toevoegen
aan deze groep.


Maak een service account aan in de Active Directory

Deze account zal gebruikt worden om verbonden te worden met de Active Directory.
Deze account heeft geen speciale rechten nodig maar zorg er gewoon voor dat het
passwoord nooit vervalt.

Maak in dit geval een gebruiker aan met de naam Solaris (password: solaris).


Maak een Active Directory user account aan voor elke Solaris machine

Gebruik de Active Directory Users and Computers tool om deze accounts aan te maken.
Voor elke account die je aanmaakt voer je het ktpass.exe commando uit om een unieke
keytab te genereren voor elke account.

In dit geval hebben we nu de Solaris machine suske.blabla.be toegevoegd als een
gebruiker in onze Active Directory ad01 aan het domein blabla.be.

Het ktpass.exe commando om de unieke keytab te genereren zal er dus als volgt
uitzien:

Code: Selecteer alles

C:\>ktpass -princ host/[email protected] -mapuser suske -crypto DES-CBC-MD5
+DesOnly -pass suske -ptype KRB5_NT_PRINCIPAL -out C:\suske.keytab
Als alles goed gegaan is moet je de volgende output krijgen:

Code: Selecteer alles

Targeting domain controller: ad01.blabla.be
Using legacy password setting method
Successfully mapped host/suske.blabla.be to Suske.
Key created.
Output keytab to C:\suske.keytab:
Keytab version: 0x502
keysize 53 host/[email protected] ptype 1 (KRB5_N
x3 (DES-CBC-MD5) keylength 8 (0x58b00e2997e057b9)
Account Suske has been set for DES-only encryption.
Kopieer vervolgens suske.keytab naar de directory “/etc/krb5” op je Solaris machine.
Zorg dat root de eigenaar is van deze file en chmod ze naar 700.


Configureer Kerberos

Code: Selecteer alles

#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)krb5.conf 1.3 04/03/25 SMI"
#
# krb5.conf template
# In order to complete this configuration file
# you will need to replace the __<name>__ placeholders
# with appropriate values for your network.
#
[libdefaults]
default_realm = BLABLA.BE
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
forwardable = yes
[realms]
BLABLA.BE = {
kdc = ad01.blabla.be
default_domain = blabla.be
}
[domain_realm]
.blabla.be = BLABLA.BE
[logging]
default = FILE:/var/krb5/kdc.log
kdc = FILE:/var/krb5/kdc.log
kdc_rotate = {
period = 1d
version = 10
}
[appdefaults]
pam = {
debug = false
4
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
Wanneer ik # kinit administrator en vervolgend # klist gebruik krijg ik het volgende:

Code: Selecteer alles

Ticket cache: FILE:/tmp/krb5cc_0
Default principal: [email protected]

Valid starting                Expires                Service principal
03/19/08 09:44:32  03/19/08 19:44:42  krbtgt/[email protected]
        renew until 03/26/08 09:44:32
Tot hiertoe gaat alles dus nog goed.

Configureer de Solaris LDAP client

Code: Selecteer alles

ldapclient -v manual \
-a credentialLevel=proxy \
-a authenticationMethod=simple \
-a proxyDN=cn=solaris,cn=Users,dc=blabla,dc=be \
-a proxyPassword=solaris \
-a defaultSearchBase=dc=blabla,dc=be \
-a domainName=blabla.be \
-a serviceSearchDescriptor=passwd:dc=blabla,dc=be?sub \
-a serviceSearchDescriptor=group:dc=blabla,dc=be?sub \
-a defaultServerList=192.168.92.210 \
-a attributeMap=group:userpassword=userPassword \
-a attributeMap=group:memberuid=memberUid \
-a attributeMap=group:gidnumber=gidNumber \
-a attributeMap=passwd:gecos=cn \
-a attributeMap=passwd:gidnumber=gidNumber \
-a attributeMap=passwd:uidnumber=uidNumber \
-a attributeMap=passwd:homedirectory=unixHomeDirectory \
-a attributeMap=passwd:loginshell=loginShell \
-a attributeMap=shadow:shadowflag=shadowFlag \
-a attributeMap=shadow:userpassword=userPassword \
-a objectClassMap=group:posixGroup=group \
-a objectClassMap=passwd:posixAccount=user \
-a objectClassMap=shadow:shadowAccount=user \
Als dit gelukt is moet je het bestand /etc/nsswitch.conf aanpassen en alle referenties
naar “ldap” verwijderen behalve voor de “user” en “group” entries.

Herstart de LDAP client service:
# svcadm restart svc:/network/ldap/client:default

Wanneer ik nu op de Solaris machine inlog als root en ik geef het volgende commando in:
# getent passwd solaris

dan krijg ik volgende output:

solaris:x:10001:10001:Solaris:/home/solaris:/bin/sh

De connectie met de AD blijkt dus te werken?


Pas de pam.conf file aan

Het laatste en volgend mij moeilijkste deel; dit is mijn pam.conf file:

Code: Selecteer alles

"/etc/pam.conf" 121 lines, 4200 characters
#
#ident  "@(#)pam.conf   1.28    04/04/21 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# PAM configuration
#
# Unless explicitly defined, all services use the modules
# defined in the "other" section.
#
# Modules are defined with relative pathnames, i.e., they are
# relative to /usr/lib/security/$ISA. Absolute path names, as
# present in this file in previous releases are still acceptable.
#
# Authentication management
#
# login service (explicit because of pam_dial_auth)
#
login   auth requisite          pam_authtok_get.so.1
login   auth required           pam_dhkeys.so.1
login   auth required           pam_unix_cred.so.1
login   auth required           pam_unix_auth.so.1
login   auth required           pam_dial_auth.so.1
#
# rlogin service (explicit because of pam_rhost_auth)
#
rlogin  auth sufficient         pam_rhosts_auth.so.1
rlogin  auth requisite          pam_authtok_get.so.1
rlogin  auth required           pam_dhkeys.so.1
rlogin  auth required           pam_unix_cred.so.1
rlogin  auth required           pam_unix_auth.so.1
#
# Kerberized rlogin service
#
krlogin auth required           pam_unix_cred.so.1
krlogin auth binding            pam_krb5.so.1
krlogin auth required           pam_unix_auth.so.1
#
# rsh service (explicit because of pam_rhost_auth,
# and pam_unix_auth for meaningful pam_setcred)
#
rsh     auth sufficient         pam_rhosts_auth.so.1
rsh     auth required           pam_unix_cred.so.1
#
# Kerberized rsh service
#
krsh    auth required           pam_unix_cred.so.1
krsh    auth binding            pam_krb5.so.1
krsh    auth required           pam_unix_auth.so.1
#
# Kerberized telnet service
#
ktelnet auth required           pam_unix_cred.so.1
ktelnet auth binding            pam_krb5.so.1
ktelnet auth required           pam_unix_auth.so.1
#
# PPP service (explicit because of pam_dial_auth)
#
ppp     auth requisite          pam_authtok_get.so.1
ppp     auth required           pam_dhkeys.so.1
ppp     auth required           pam_unix_cred.so.1
ppp     auth required           pam_unix_auth.so.1
ppp     auth required           pam_dial_auth.so.1
#
# Default definitions for Authentication management
# Used when service name is not explicitly mentioned for authentication
#
other   auth requisite          pam_authtok_get.so.1
other   auth required           pam_dhkeys.so.1
other   auth required           pam_unix_cred.so.1
other   auth sufficient         pam_krb5.so.1
other   auth required           pam_unix_auth.so.1
#
# passwd command (explicit because of a different authentication module)
#
passwd  auth required           pam_passwd_auth.so.1
#
# cron service (explicit because of non-usage of pam_roles.so.1)
#
cron    account required        pam_unix_account.so.1
#
# Default definition for Account management
# Used when service name is not explicitly mentioned for account management
#
other   account requisite       pam_roles.so.1
other   account sufficient      pam_ldap.so.1
other   account sufficient      pam_unix_account.so.1
#
# Default definition for Session management
# Used when service name is not explicitly mentioned for session management
#
other   session required        pam_unix_session.so.1
#
# Default definition for  Password management
# Used when service name is not explicitly mentioned for password management
#
other   password required       pam_dhkeys.so.1
other   password requisite      pam_authtok_get.so.1
other   password sufficient     pam_krb5.so.1
other   password requisite      pam_authtok_check.so.1
other   password required       pam_authtok_store.so.1
#
# Support for Kerberos V5 authentication and example configurations can
# be found in the pam_krb5(5) man page under the "EXAMPLES" section.
#

Ik kan nu via ssh nog altijd inloggen als root op de solaris machine, maar wanneer ik wil inloggen als een andere gebruiker uit de AD dan krijg ik telkens volgende melding:

login as: solaris
Using keyboard-interactive authentication.
Password:
Access denied
Using keyboard-interactive authentication.


Volgens mij zit de fout ergens in de pam.conf, maar ik raak er maar niet aan uit.
Plaats reactie

Terug naar “Software en apps”