GSS JAAS не может прочитать хранилище ключей / вкладку

Я пытаюсь подключиться к базе данных, используя Kerberos, все работает, кроме двух проблем. Во-первых, когда я выполняю свой код, меня просят два ввести мой пароль не один раз, а дважды. Затем мой запрос отправляется в мою базу данных и результаты возвращаются.

Вышеупомянутая проблема проистекает из того, что я верю в основную причину, или во вторую проблему, с которой я столкнулся, это неспособность JDK прочитать keytab.

com.sun.security.jgss.initiate {
    com.sun.security.auth.module.Krb5LoginModule required
    useKeyTab=true
    useTicketCache=true
    principal="principal@REALM"
    useDefaultCcache=true
};

com.sun.security.jgss.accept  {
  com.sun.security.auth.module.Krb5LoginModule required
  ticketCache=true
  storeKey=true;
};

Apr 22, 2016 2:27:46 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Cluster created with settings {hosts=[realm:27017], mode=MULTIPLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
Apr 22, 2016 2:27:46 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Adding discovered server realm:27017 to client view of cluster
Apr 22, 2016 2:27:46 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: No server chosen by ReadPreferenceServerSelector{readPreference=primary} from cluster description ClusterDescription{type=UNKNOWN, connectionMode=MULTIPLE, all=[ServerDescription{address=realm:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
Kerberos password for principal@REALM: ******
Apr 22, 2016 2:27:52 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Opened connection [connectionId{localValue:1, serverValue:1001}] to realm:27017
Apr 22, 2016 2:27:52 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Monitor thread successfully connected to server with description ServerDescription{address=realm:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 2, 5]}, minWireVersion=0, maxWireVersion=4, maxDocumentSize=16777216, roundTripTimeNanos=128643970}
Apr 22, 2016 2:27:52 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Discovered cluster type of STANDALONE
Kerberos password for principal@REALM: ******
Apr 22, 2016 2:27:57 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Opened connection [connectionId{localValue:2, serverValue:1002}] to realm:27017
****output from mongo****

Я понимаю, что не отключил ввод с клавиатуры, но это потому, что, как вы видите из вывода выше, я не могу прочитать таблицу ключей или кэш.

Сервер и клиент имеют соответствующий krb5.conf, я могу kinit, ktadd, klist все ожидаемые принципалы с правильными типами enc.

Я даже дошёл до chmod 777 keytab, чтобы убедиться, что это не проблема с разрешениями.

1 ответ

Решение

Это была проблема с разрешениями, я не смог прочитать файл кэша в /tmp

Другие вопросы по тегам