使用 ktutil 创建服务主体

发布于 2025-01-20 18:14:04 字数 1640 浏览 1 评论 0原文

目前我可以使用 2 个虚拟机(windows-server 和 linux)来启动服务。但我在 Windows 服务器(即域控制器)上生成密钥表。
我想从 Linux 创建密钥表。

目前我正在

  • AD windows 服务器 [DOMAIN MYNETWORK.NET] 中执行以下操作

  • 创建服务 = aservice

  • 创建安全组 = ServiceAcc

  • 使服务成员成为ServiceAcc

  • 创​​建一个 User = auser,它是 OU 的域控制器

  • 创建一个 User = auser,它是 OU

    setspn -S HTTP/aservice.mynetwork.net auser

  • keytab: ktpass -Out service-a.keytab -Princ HTTP/[电子邮件受保护] -mapUser auser -Crypto All -Ptype KRB5_NT_PRINCIPAL -Pass *

在linux中配置 krb5.conf 并将 dns 指向 AD:

所以这可以正常工作。如果我不与用户一起执行密钥表,我将无法 kinit 等。

现在,我遇到的问题是如何直接从 Linux 执行所有这些操作,我不知道如何执行此操作。我能找到的所有文档都是执行以下操作:

  • ktutil
  • ktutil: addent -password -p auser -k 1 -e aes256-cts
  • Password for [email protected]:
  • ktutil: wkt auser.keytab

但是:

  1. 之后我无法 kinit。
  2. 这仅添加用户,而不添加服务。我可以对服务执行相同的操作,但我不会添加用户。
    我看到了一种可以使用 kadmin 做到这一点的方法,但我也遇到了问题,因为每次我尝试使用它时都会遇到识别问题。

Currently I'm able to kinit to a service using 2 vms (windows-server and linux). But I generate the keytab on the windows server, which is the domain controller.
I want to create the keytab from linux.

Currently I'm doing the following

  • in AD windows server [DOMAIN MYNETWORK.NET]

  • Create a service = aservice

  • Create a security group = ServiceAcc.

  • Make aservice member of ServiceAcc

  • Create a User = auser which is a Domain Controller of an OU

  • setspn -S HTTP/aservice.mynetwork.net auser

  • keytab: ktpass -Out service-a.keytab -Princ HTTP/[email protected] -mapUser auser -Crypto All -Ptype KRB5_NT_PRINCIPAL -Pass *

In linux with krb5.conf configurated and dns pointing to the AD:

So this works correctly. If I don't do the keytab with the user I can't kinit, etc.

Now, the issue I'm having is how to do all this directly from Linux and I'm not sure how to perfor this. All the documentation I can find is to do the following:

  • ktutil
  • ktutil: addent -password -p auser -k 1 -e aes256-cts
  • Password for [email protected]:
  • ktutil: wkt auser.keytab

But:

  1. I can't kinit after that.
  2. This only adds a user, not the service. I could do the same with the service but then I'm not adding the user.
    I saw a way to possible do this with kadmin, but I was having issues with that too as I get identification issues every time I try to use it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文