Drift/Kerberos: Difference between revisions

From Programvareverkstedet
(Nå med mindre kompleksitet i klientoppsettet!)
(Fjernet redundant tekst og omstrukturert litt)
Line 42: Line 42:
<pre><nowiki>
<pre><nowiki>
aptitude install heimdal-clients og heimdal-kdc
aptitude install heimdal-clients og heimdal-kdc
</nowiki></pre>
Lag symlink (på grunn av en bug i heimdal-kdc): <pre><nowiki>
ln -s /etc/heimdal-kdc/kadmind.acl /var/lib/heimdal-kdc/
</nowiki></pre>
Rediger /etc/heimdal-kdc/kdc.conf og sett følgende opsjoner: <pre><nowiki>
[password_quality]
min_length = 8
[kadmin]
default_keys = aes256-cts-hmac-sha1-96:pw-salt aes128-cts-hmac-sha1-96:pw-salt des3-cbc-sha1:pw-salt arcfour-hmac-md5:pw-salt
</nowiki></pre>
</nowiki></pre>


Line 50: Line 62:
Realm max ticket life [unlimited]:
Realm max ticket life [unlimited]:
Realm max renewable ticket life [unlimited]:
Realm max renewable ticket life [unlimited]:
kadmin: create_random_entry(krbtgt/PVV.NTNU.NO@PVV.NTNU.NO): randkey failed: Principal or policy already exists
kadmin: create_random_entry(kadmin/changepw@PVV.NTNU.NO): randkey failed: Principal or policy already exists
kadmin: create_random_entry(kadmin/admin@PVV.NTNU.NO): randkey failed: Principal or policy already exists
kadmin: create_random_entry(changepw/kerberos@PVV.NTNU.NO): randkey failed: Principal or policy already exists
kadmin: create_random_entry(kadmin/hprop@PVV.NTNU.NO): randkey failed: Principal or policy already exists
kadmin: kadm5_create_principal: Principal or policy already exists
</nowiki></pre>
</nowiki></pre>


Line 81: Line 87:
</nowiki></pre>
</nowiki></pre>


Lag deg en admin-principal
Lag deg en admin-principal (se eget kapittel)
<pre><nowiki>
kadmin> add knuta/admin
Max ticket life [1 day]:
Max renewable life [1 week]:
Principal expiration time [never]:
Password expiration time [never]:
Attributes [requires-pre-auth]:
knuta/admin@PVV.NTNU.NO's Password:
Verifying - knuta/admin@PVV.NTNU.NO's Password:
</nowiki></pre>
 
Rediger /etc/heimdal-kdc/kadmind.acl og legg til følgende:<pre><nowiki>
knuta/admin all
</nowiki></pre>
 
Lag symlink (på grunn av en bug i heimdal-kdc): <pre><nowiki>
ln -s /etc/heimdal-kdc/kadmind.acl /var/lib/heimdal-kdc/
</nowiki></pre>
 
Rediger /etc/heimdal-kdc/kdc.conf og sett følgende opsjoner: <pre><nowiki>
[password_quality]
min_length = 8
 
[kadmin]
default_keys = aes256-cts-hmac-sha1-96:pw-salt aes128-cts-hmac-sha1-96:pw-salt des3-cbc-sha1:pw-salt arcfour-hmac-md5:pw-salt
</nowiki></pre>
 


==Lage admin-principal==
==Lage admin-principal==

Revision as of 22:48, 18 April 2010

Nye kerberos-klienter

Logg inn på maskinen.

installer heimdal:

berners-lee:~# aptitude install heimdal-clients libpam-krb5

Last ned keytab (den blir generert automatisk)

berners-lee:~# ktutil get -p knuta/admin host/berners-lee.pvv.ntnu.no

Konfigurer pam. Oppsettet kan for eksempel se slik ut på en debian-maskin:

/etc/pam.d/common-account:

account required        pam_krb5.so     minimum_uid=1000
account required        pam_unix.so

/etc/pam.d/common-auth:

auth    sufficient      pam_krb5.so     minimum_uid=1000
auth    required        pam_unix.so nullok_secure

/etc/pam.d/common-password:

# NB! Sjekk denne, den ser litt feil ut!
password        sufficient      pam_krb5.so     minimum_uid=1000
password   required   pam_unix.so nullok obscure md5

/etc/pam.d/common-session:

session optional        pam_krb5.so     minimum_uid=1000
session required        pam_unix.so

Installasjon av KDC

Rediger /etc/hosts så public-ipen (f.eks. 129.241.210.168) peker på hostnavnet til kdc, ellers virker det ikke.

Installer heimdal-clients og heimdal-kdc

aptitude install heimdal-clients og heimdal-kdc

Lag symlink (på grunn av en bug i heimdal-kdc):

ln -s /etc/heimdal-kdc/kadmind.acl /var/lib/heimdal-kdc/

Rediger /etc/heimdal-kdc/kdc.conf og sett følgende opsjoner:

[password_quality]
min_length = 8

[kadmin]
default_keys = aes256-cts-hmac-sha1-96:pw-salt aes128-cts-hmac-sha1-96:pw-salt des3-cbc-sha1:pw-salt arcfour-hmac-md5:pw-salt

Logg inn lokalt (siden det ikke finnes noen adminbrukere enda)

asgard:~# kadmin -l
kadmin> init PVV.NTNU.NO
Realm max ticket life [unlimited]:
Realm max renewable ticket life [unlimited]:

Juster default-innstillingene litt

kadmin> modify -a -disallow-all-tix,requires-pre-auth default
kadmin> get default
            Principal: default@PVV.NTNU.NO
    Principal expires: never
     Password expires: never
 Last password change: 2009-06-16 18:16:07 UTC
      Max ticket life: 1 day
   Max renewable life: 1 week
                 Kvno: 1
                Mkvno: 0
Last successful login: never
    Last failed login: never
   Failed login count: 0
        Last modified: 2009-06-16 18:18:43 UTC
             Modifier: kadmin/admin@PVV.NTNU.NO
           Attributes: requires-pre-auth
             Keytypes: aes256-cts-hmac-sha1-96(pw-salt), aes128-cts-hmac-sha1-96(pw-salt), des3-cbc-sha1(pw-salt), arcfour-hmac-md5(pw-salt)
          PK-INIT ACL: 
              Aliases: 

Lag deg en admin-principal (se eget kapittel)

Lage admin-principal

Logg inn som root på asgard (via SSH fra decibel).

asgard:~# kadmin -l
kadmin> add knuta/admin
Max ticket life [1 day]:
Max renewable life [1 week]:
Principal expiration time [never]:
Password expiration time [never]:
Attributes [requires-pre-auth]:
knuta/admin@PVV.NTNU.NO's Password: 
Verifying - knuta/admin@PVV.NTNU.NO's Password: 

Rediger /etc/heimdal-kdc/kadmind.acl og legg til følgende:

knuta/admin all