Dear Tumasgiu
Rossini,
When I do the ktpass command on Windows AD, I can see that
there is no other AD account mapped, otherwise it will raise an exception (Failed to set property 'servicePrincipalName').
Here is the klist command:
root@SFADAPGDDF02:/# klist -k /etc/postgresql/postgres.keytab
KVNO Principal
---- --------------------------------------------------------------------------
4 postgres/UBUNTU.ad.corp.com@xxxxxxxxxxx
Windows AD command:
PS C:\Users\Administrateur>
get-aduser pgsql_ubuntu -properties msDS-KeyVersionNumber
DistinguishedName : CN=pgsql_ubuntu,CN=Managed Service Accounts,DC=ad,DC=corp,DC=com
Enabled : True
GivenName : pgsql_ubuntu
msDS-KeyVersionNumber : 4
Name : pgsql_ubuntu
ObjectClass : user
ObjectGUID : dcaadc3c-2faf-44cf-a558-2a441cca690c
SamAccountName : pgsql_ubuntu
SID : S-1-5-21-1388463811-2779960163-2428466526-1204
Surname :
UserPrincipalName : postgres/UBUNTU.ad.corp.com@xxxxxxxxxxx
If I look at the postgresql.log,
I saw another kvno number. This one is matching the user trying to connect.
2023-05-26 18:30:08.576
UTC [4033] jp.chenel@template1 LOG: accepting GSS security context failed
2023-05-26 18:30:08.576 UTC [4033] jp.chenel@template1 DETAIL: Unspecified GSS failure. Minor code may provide more information: Request ticket server postgres/sfadapgddf02.ad.sygifcorp.com@xxxxxxxxxxxxxxxx not found in keytab (ticket kvno 3) Like I said, if I make a new keytab, just changing "-pass postgres", connections will work again. How to change this password !
For security reason, I don't want to let this password.
With best regards,
De : Tumasgiu Rossini <rossini.t@xxxxxxxxx>
Envoyé : 26 mai 2023 12:09 À : Jean-Philippe Chenel <jp.chenel@xxxxxxx> Objet : Re: PostgreSQL GSSAPI Windows AD Hi,
are you sure that there is no other ad account mapped to the
postgres/UBUNTU.ad.corp.com@xxxxxxxxxxx principal ?
Also you should check that the kvnos of both your keytab and your ad account matches, with the following commands :
in linux for the keytab
klist /path/to/the/keytab
and in Windows for the account
get-aduser <username> -properties msDS-KeyVersionNumber
Le jeu. 25 mai 2023 à 23:51, Jean-Philippe Chenel <jp.chenel@xxxxxxx> a écrit :
|