我正在使用GSSAPI进行开发,并且我的代码与vanilla MIT Kerberos 5服务器一起工作以执行一些客户端/服务器工作.我现在正在验证它对Active Directory的功能,我遇到了一个问题.
我的服务器经过身份验证和监听.我可以让客户登录.为了记录,这是基于http://thejavamonkey.blogspot.com/2008/04/clientserver-hello-world-in-kerberos.html的代码.但是,我无法让客户端从AD获取故障单以获取它与服务器之间的会话.我得到KrbException:在Kerberos数据库(7)中找不到服务器,我无法弄清楚添加它的适当位置.我已经尝试将服务器名称与ip放在hosts文件中,更新dns,放入服务器记录等,没有运气.
如果有人知道更新AD以在Kerberos数据库中设置服务器的适当位置,那就太棒了!
所以我有一些代码,我正在测试,以确保它可以很好地进行身份验证.它可以很好地对抗直接的kerberos,所以我认为应该只有一些与AD的轻微打嗝.不幸的是,我无法解决KrbException:KDC不支持加密类型(14).
我知道错误是加密类型不匹配.但我可以开得很好,这只是在我遇到问题的代码中.我没有设置任何东西,所以我认为它应该继承与kinit相同的默认值,但显然情况并非如此.
代码-
System.setProperty("sun.security.krb5.debug", "true");
System.setProperty("java.security.krb5.realm", "TEST.SQRRL.COM");
System.setProperty("java.security.krb5.kdc", "172.16.101.128");
System.setProperty("java.security.auth.login.config", "./conf/jaas.conf");
System.setProperty("javax.security.auth.useSubjectCredsOnly", "true");
// "Client" references the JAAS configuration in the jaas.conf file.
LoginContext loginCtx = null;
loginCtx = new LoginContext("Server", new LoginCallbackHandler("test".toCharArray()));
loginCtx.login();
subject = loginCtx.getSubject();
Run Code Online (Sandbox Code Playgroud)
和jaas.conf
Server {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=false
storeKey=true
useTicketCache=true
principal="accumulo@test.SQRRL.COM";
};
Run Code Online (Sandbox Code Playgroud)
并且,堆栈跟踪 -
>>>KRBError:
sTime is Tue Nov 27 18:16:36 EST 2012 1354058196000
suSec is 257213
error code is 14
error Message is KDC has no support for encryption type
realm is test.SQRRL.COM
sname …
Run Code Online (Sandbox Code Playgroud) 所以我正在尝试编写一些满足LSB的init.d脚本,以便它们在启动和关闭时正常运行.不幸的是,我遇到了LSB/update-rc.d以满足依赖性的问题.
# Required-Start: $network $local_fs hadoop-namenode hadoop-datanode zookeeper-server
# Required-Stop: $network $local_fs hadoop-namenode hadoop-datanode zookeeper-server
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
Run Code Online (Sandbox Code Playgroud)
但是,当我运行update-rc.d默认值时,它只会生成所涉及的默认值,其启动时间与已经存在的相同,这会破坏可怕的事情.我是否遗漏了update-rc.d或LSB来配置这个?
如果它是相关的,这是Ubuntu 12.04