2016-04-22 15 views
1

Kerberosを使用してデータベースに接続しようとしていますが、2つの問題を除いてすべて動作します。まず、自分のコードを実行すると、2回は2回だけでなく2回パスワードを入力するように求められます。その後、私のクエリが私のデータベースに送られ、結果が返されます。GSS JAASがキーストア/タブを読み取ることができません。

上記の問題は、私が根本原因を信じていること、または私が持っている2番目の問題に起因しています.JDKはキータブを読み取ることができません。

com.sun.security.jgss.initiate { 
    com.sun.security.auth.module.Krb5LoginModule required 
    useKeyTab=true 
    useTicketCache=true 
    principal="[email protected]" 
    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 [email protected]: ****** 
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 [email protected]: ****** 
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まで行っていました。

答えて

1

これはアクセス権の問題で、私は/ tmpの下のキャッシュファイルを読み取ることができませんでした

+0

この場合、あなたの答えは「受け入れられました」と記入してください。 –

関連する問題