Kerberos客户端常用命令包括 kinitklistkdestroy, and kpasswd,用户使用这些命令管理自己的 ticket。

此外,每台运行Kerberos的机器应该都配置/etc/krb5.conf,At a minimum, it should define a default_realm setting in [libdefaults]. If you are not using DNS SRV records, it must also contain a [realms] section containing information for your realm’s KDCs.

Ticket 管理

Kerberos Ticket的若干属性:

  • forwardable 简单来讲,KDC可以基于该类型TGT发放新的TGT,即使 network address不同。这样不需要再次输入密码。
  • proxiable 类似于forwardable,但是不同的是只允许service继承client的认证
  • proxy
  • postdated
  • Renewable 用户不需要重新输入密码就可以获得新的 session key. 但是这种TGT有过期时间。
  • invalid
  • hardware authentication 申请使用硬件的Ticket认证
  • okay as delegate ticket指定的服务器可以用作delegate determined by the policy of that realm
  • anonymous ticket is one in which the named principal is a generic principal for that realm; it does not actually specify the individual that will be using the ticket. This ticket is meant only to securely distribute a session key.

用 kinit 获得Ticket

如果你的登录系统集成了Kerberos v5,那么登录时自动获得kerberos ticket. 否则,必须显示获取,比如用 kinit。类似,如果 ticket过期了,kinit可以申请新的ticket.

By default, kinit假设你想要默认realm里与自己名字相同的principal的ticket。

shell% kinit
Password for jennifer@ATHENA.MIT.EDU: <-- [Type jennifer's password here.]
shell%

如果想要申请 forwardable ticket,可以

shell% kinit -f
Password for jennifer@ATHENA.MIT.EDU: <-- [Type your password here.]
shell%
shell% kinit -f -l 3h david@EXAMPLE.COM
Password for david@EXAMPLE.COM: <-- [Type david's password here.]
shell%

用 klist 查看 ticket

当你第一次获得 ticket, 那么只能是TGT,看起来如下:

shell% klist
Ticket cache: /tmp/krb5cc_ttypa
Default principal: jennifer@ATHENA.MIT.EDU Valid starting Expires Service principal
// :: // :: krbtgt/ATHENA.MIT.EDU@ATHENA.MIT.EDU
shell%

如果连接到其他机器上,比如:daffodil.mit.edu,但是在同一个realm,klist会得到

shell% klist
Ticket cache: /tmp/krb5cc_ttypa
Default principal: jennifer@ATHENA.MIT.EDU Valid starting Expires Service principal
// :: // :: krbtgt/ATHENA.MIT.EDU@ATHENA.MIT.EDU
// :: // :: host/daffodil.mit.edu@ATHENA.MIT.EDU
shell%

当jennifer用ssh程序登陆主机daffodil.mit.edu,ssh程序将jennifer的TGT给KDC,并请求主机ticket,这样jennifer不用再输入密码。

klist有各种flag,具体可以通过 man klist 查看。

用 kdestory 销毁ticket.

由于ticket可能被偷走,这样离开机器的时候可以顺便销毁ticket.

shell% kdestroy
shell%

其他客户端命令

  • kdestroy: kdestroy utility destroys the user’s active Kerberos authorization tickets by overwriting and deleting the credentials cache that contains them
  • kinit: kinit obtains and caches an initial ticket-granting ticket(TGT) for principal
  • klist: klist lists the Kerberos principal and Kerberos tickets held in a credentials cache, or the keys held in a keytab file.
  • kpasswd: kpasswd command is used to change a Kerberos principal’s password
  • krb5-config
  • ksu
  • kswitch
  • kvno
  • sclient

[Kerberos] User Ticket Management的更多相关文章

  1. FIM 2010: Kerberos Authentication Setup

    The goal of this article is to provide some background information regarding the Kerberos related co ...

  2. KERBEROS PROTOCOL TUTORIAL

    KERBEROS PROTOCOL TUTORIAL   This tutorial was written by Fulvio Ricciardi and is reprinted here wit ...

  3. Magic Quadrant for Security Information and Event Management

    https://www.gartner.com/doc/reprints?id=1-4LC8PAW&ct=171130&st=sb Summary Security and risk ...

  4. Kerberos主从配置文档

    Kerberos主从配置文档   1. Kerberos主从同步机制 在Master上通过以下命令同步数据: kdb5_util dump /var/kerberos/krb5kdc/slave_db ...

  5. kafka Enabling Kerberos Authentication

    CDK 2.0 and higher Powered By Apache Kafka supports Kerberos authentication, but it is supported onl ...

  6. 票据传递攻击(Pass the Ticket,PtT)

    目录 黄金票据 生成票据并导入 查看票据 验证是否成功 黄金票据和白银票据的不同 票据传递攻击(PtT)是一种使用Kerberos票据代替明文密码或NTLM哈希的方法.PtT最常见的用途可能是使用黄金 ...

  7. httpcomponents-client-4.4.x

    Chapter 1. Fundamentals Prev     Next Chapter 1. Fundamentals 1.1. Request execution The most essent ...

  8. httpcomponents-client-ga(4.5)

    http://hc.apache.org/httpcomponents-client-ga/tutorial/html/   Chapter 1. Fundamentals Prev     Next ...

  9. httpcomponents-client-4.3.x DOC

    Chapter 1. Fundamentals Prev     Next Chapter 1. Fundamentals 1.1. Request execution The most essent ...

随机推荐

  1. zookeeper原理

    Zookeeper与paxos算法:http://www.riaos.com/ria/11299 Paxos算法1:http://blog.csdn.net/chen77716/article/det ...

  2. POJ3160 Father Christmas flymouse[强连通分量 缩点 DP]

    Father Christmas flymouse Time Limit: 1000MS   Memory Limit: 131072K Total Submissions: 3241   Accep ...

  3. 第九章 JQUI

    一.什么是插件 ①是遵循一定接口规范编写的程序 ②是原有系统平台功能的扩展和补充 ③只能运行在规定的系统平台下,而不能单独运行 注:由于jQuery插件是基于jQuery脚本库的扩展,所以所有jQue ...

  4. Matlab中使用脚本和xml文件自动生成bus模块

    帮一个老师写的小工具 在一个大工程中需要很多bus来组织信号,而为了规范接口,需要定义很多BusObject,用Matlab语言手写这些BusObject比较费工夫 所以用xml配置文件来写,也便于更 ...

  5. YII2如何修改默认控制器/方法

    在网上找了非常多的方法,但是都不好使最后自己综合网上所有自己琢磨出来的,见笑了 首先Yii2中在/vendor/yiisoft/yii2/web/Application.php的第28行 public ...

  6. GO语言总结(1)——基本知识

    1.注释(与C++一样) 行注释:// 块注释:/* ... */ 2.标识符 可以这么说,除了数字开头的不允许,符号开头的不允许,关键字不允许,其他的Unicode字符组合都可以.“_33”也可以是 ...

  7. js阿拉伯数字转中文大写

    function DX(n) { if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) return "数据非法"; var unit = "千百 ...

  8. sql server cross/outer apply 用法

    这是 sql server 帮助文档关于apply的描述: 使用 APPLY 运算符(2005或以上版本)可以为实现查询操作的外部表表达式返回的每个行调用表值函数.表值函数作为右输入,外部表表达式作为 ...

  9. C#进阶系列——DDD领域驱动设计初探(五):AutoMapper使用

    前言:前篇搭建了下WCF的代码,就提到了DTO的概念,对于为什么要有这么一个DTO的对象,上章可能对于这点不太详尽,在此不厌其烦再来提提它的作用: 从安全上面考虑,领域Model都带有领域业务,让Cl ...

  10. struts2+spring+hibernate(SSH)框架的搭建和总结

    SSH框架:struts2+spring+hibernate,是目前较流行的一种Web应用程序开源集成框架,用于构建灵活.易于扩展的多层Web应用程序. struts2+spring+hibernat ...