大网数据广告活动
服务器运维问答

Which servers to copy keytab file to

· 52CE 我爱测

I am trying to setup a simple Kerberos environment in which a client server authenticates to a webservice (in my case OpenSSH) via a Kerberos server. I generated a keytab file on the KDC but am not quite sure which servers to cop…

问题原文

原帖链接 · arne.z · CC BY-SA 3.0

I am trying to setup a simple Kerberos environment in which a client server authenticates to a webservice (in my case OpenSSH) via a Kerberos server.

I generated a keytab file on the KDC but am not quite sure which servers to copy the file to. Do I only need to copy it to the machine that is offering the service or also to the client machine that wants to authenticate to the service?

已采纳解答

原帖链接 · olivierg · CC BY-SA 3.0

in a normal situation, the keytab file you created (usually, using a service account principal (or instance), for example ssh/hostname) should be placed on the "client" of that kerberos service.

and on this client, you will use this keytab (caching the account credentials) to authenticate your service against the KDC, with a command like this one (in the case of a service, this is usually done by the service, in its code or via a script, at boot time) :

kinit -kt /path/to/keytab.file principal/name

keytabs somehow contain your account (or service account) credentials (e.g principal & password) so that you don't have to authenticate manually but you can do it automatically using this keytab (and the keytab should have strict permissions,naturly)

hope that helps

note : the KDC also uses keytabs, be careful not to upload this keytab to your client! it contains KDC/kadmin information !

to be sure that you are using the right one, you can connect to your KDC from the client using kadmin and create the keytab from there, for example:

client$ kadmin -p your_admin_login/admin  # login to the KDC
client$ kadmin> ktadd -kt /path/to/keytab.keytab <principal_name>  # generate a keytab locally for account principal_name
client$ kadmin> exit
client$ kinit -kt /path/to/keytab.keytab <principal_name> # test it
client$ <configure the keytab path in your app>

regards,

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-06-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。