`

keytab file in kerberos

 
阅读更多

How to create a keytab file for a Kerberos user logging into Active Directory.  What's a keytab file?  It's basically a file that contains a table of user accounts, with an encrypted hash of the user's password.  Why have a keytab file?  Well, when you want a server process to automatically logon to Active Directory on startup, you have two options:  type the password (in clear text) into a config file somewhere, or store an encrypted hash of the password in a keytab file.  Which is safer?  Well, you can decide.  In any case, you'd better do a good job of protecting the file (be it a config file or a keytab).

Anyway, the accepted way to store a hashed password in Kerberos is to use a keytab file.  Now the file can be created using a number of utilities.  On a Windows machine, you can use ktpass.exe.  On Ubuntu Linux, you can use ktutil.

<iframe id="aswift_1" style="left: 0px; position: absolute; top: 0px;" name="aswift_1" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="468" height="60"></iframe> 

Before I demonstrate how to create the keytab, a word about encryption.  There are a number of encryption types used for hashing a password.  These include DES-CBC-CRC, DES-CBC-MD5, RC4-HMAC and a few others.  Active Directory uses RC4-HMAC by default.  Back in Windows 2000, you could also use the DES types without any trouble, but since Windows 2003, only RC4-HMAC is supported, unless you make a registry change (to all of your domain controllers).  If you need to use DES for some reason, then refer to the Technet article at the bottom of the page.

Before attempting to create a keytab file, you'll need to know the user's kerberos principal name, in the form of username@MYDOMAIN.COM, and the user's password.

Creating a KeyTab on Windows (tested on Windows Server 2008 R2)
Open a command prompt and type the following command:

ktpass /princ username@MYDOMAIN.COM /pass password /ptype KRB5_NT_PRINCIPAL /out username.keytab
 

Creating a KeyTab on Ubuntu Linux (tested on Ubuntu 10.10 - Maverick Meerkat)
Open a terminal window and type the following commands:

ktutil
addent -password -p username@MYDOMAIN.COM -k 1 -e RC4-HMAC
- enter password for username -
wkt username.keytab
q

Testing the Keytab File
Now in order to test the keytab, you'll need a copy of kinit.  You can use the version that's on Ubuntu, or if on Windows, you can install the latest Java runtime from Sun (JRE).  In either case, you'll need to setup your /etc/krb5.conf file (on Linux) or c:\windows\krb5.ini (on Windows).  Either file should look something like this:

[libdefaults]
default_realm = MYDOMAIN.COM
krb4_config = /etc/krb.conf
krb4_realms = /etc/krb.realms
kdc_timesync = 1
ccache_type = 4
forwardable = true
proxiable = true

[realms]
MYDOMAIN.COM = {
kdc = mydomain.com:88
admin_server = mydomain.com
default_domain = mydomain.com
}

[domain_realm]
.mydomain.com = MYDOMAIN.COM
mydomain.com = MYDOMAIN.COM

[login]
krb4_convert = true
krb4_get_tickets = false

Once you've got your Kerberos file setup, you can use kinit to test the keytab.  First, try to logon with your user account without using the keytab:

kinit username@MYDOMAIN.COM
- enter the password - 

If that doesn't work, your krb5 file is wrong.  If it does work, now try the keytab file:

kinit username@MYDOMAIN.COM -k -t username.keytab

Now you should successfully authenticate without being prompted for a password.  Success!

More Information
If you need to use any other encryption Type than RC4-HMAC, then you'll need to tweak your AD domain controllers.  Please refer to the following TechNet article.

分享到:
评论

相关推荐

    ruby_keytab_parser:Ruby的Kerberos KeyTab解析器

    ruby_keytab_parser

    kerberos 基础知识和安装操作

    kerberos 的基础术语、验证过程讲解、安装步骤及操作使用。

    flask-kerberos:烧瓶的Kerberos身份验证

    不幸的是,与大多数kerberos一样,它需要一个kerberos环境以及一个keytab。 进行设置超出了本文档的范围。 该文档的正式副本可在“。安装使用以下命令之一安装扩展: $ easy_install Flask-Kerberos或者,如果您已...

    greenplum-db-6.2.1-rhel7-x86_64.rpm

    The PXF_USER_IMPERSONATION, PXF_PRINCIPAL, and PXF_KEYTAB settings in the pxf-env.sh file. You can use the pxf-site.xml file to configure Kerberos and impersonation settings for your new Hadoop server...

    gokrb5:用于客户端和服务的Pure Go Kerberos库

    gokrb5 建议使用最新版本: 开发将集中在最新的主要版本上。 新功能将仅针对此版本。 版本号 依赖管理 ...解析Keytab文件 解析krb5.conf文件 解析客户端凭据缓存文件,例如/tmp/krb5cc_$(id -u $

    Python通过kerberos安全认证操作kafka方式

    如何通过Kerberos认证. 1.安装Kerberos客户端 CentOS: yum install krb5-workstation 使用which kinit查看是否安装成功; 2.拷贝Kerberos配置文件 conf目录下krb5.conf和kafka.keytab和jaas.conf拷贝到客户端机器...

    .NET使用Kerberos票证到Hadoop连接

    使用Keytab文件从.NET到Hadoop连接

    keytabGUI-开源

    Kerberos Keytab文件的GUI。 将其与* .keytab扩展名关联以查看它们。 JNLP安装程序页面:http://keytabgui.sourceforge.net

    KeyTab-crx插件

    语言:English (United States) 触手可及的热门网站! KeyTab是一种浏览器扩展程序,可以快速轻松地访问背景优美且界面友好的热门站点。

    duojichaidan_rar单片机多级菜单_c

    unsigned int KeyTab_MaxItems; //本级菜单最大条目数 unsigned int KeyTab_PressOk; //按下"回车"键时转向的状态索引号 unsigned int KeyTab_PressEsc; //按下"返回"键时转向的状态索引号 unsigned int ...

    distrobuild:发行商

    的Kerberos kinit -R -kt {PATH_TO_KEYTAB} koji/distrobuild@ROCKYLINUX.ORG -S HTTP/koji.rockylinux.org@ROCKYLINUX.org 使用者介面 cd ui yarn yarn start 服务器 virtualenv .venv source .venv/bin/activate ...

    8279可编程设置型键盘

    KEYTAB: DB 0C1H,0C8H,0C9H,0D0H,0D8H,0E0H,0C2H,0CAH,0D1H,0D9H DB 0DAH,0C3H,0CBH,0D2H,0D3H,0DBH KEYTAB1:DB 0E3H,0E2H,0E1H CDATA: DB 0CH,9FH,4AH,0BH,99H,29H,28H,8FH,08H,09H,88H,38H,6CH,1AH,68H,0E8H LOOP...

    单片机的多重菜单设计.docx

    # define SIZE_OF KEYBD_MENU 55 / / 菜单总长度 KbdTabSt ruct code KeyTab[ SIZE_OF_ KEYBD_MENU ] = { {0 ,0 ,0 ,1 ,0 , MainJob1 } {1 ,7 ,2 ,8 ,0 , Dsp Point} , / / 第一层 {2 ,1 ,3 ,8 ,0 , DspCurve}, / /...

    单片机菜单程序

    非常适用的C51单片机LCD 3级菜单子程序 KeyFuncPtr=KeyTab[KeyFuncIndex].CurrentOperate; (*KeyFuncPtr)();//执行当前按键的操作 } //其中KeyTab的设计颇费尽心机

    贝岭的matlab的代码-puppet-cobald:基于COBalD/TARDIS的机会资源管理的Puppet模块

    filename_cobald_keytab [ String ] COBalD 服务主体密钥表文件名(如果 LBS 使用 Kerberos 身份验证)。 ssh_hostname [ String ] 访问LBS的主机主机名(如果使用ssh认证访问LBS) ssh_username [ String ] 用于ssh...

    springBoot_hbase_phoenix_mybatis:spring boot 使用mybatis连接phoenix使用hbase

    springBoot_hbase_phoenix_mybatisspring boot 使用mybatis连接phoenix使用hbase##当前版本:phoenix:4.13.1-HBase-1.2 (与hbase服务器phoenix版本一致)spring boot:2.0.2.RELEASE##注意:无法与swagger2集成:...

    KDC集群安装&维护文档

    Cannot create cert chain: certificate has expired 此错误消息表明KINIT身份验证失败,因为客户端证书,KDC证书或其上方签名链中的某个证书已过期 ...3、从节点的默认位置具有keytab文件,且具有主机的信息。

    Keymenu少按键实现多功能切换

    实现菜单式功能,主要体现在用少数几个按键可以调用多种界面,以及多个程序入口,其中其中KeyTab的设计颇有技巧。

    springboot集成hbase

    本示例示springboot集成hbase的一个工具,用户下载后,只需要更改HBaseUtil类中的配置为自己的hbase服务器上的相关配置及更改resources下hbase.keytab和krb5.conf文件为自己服务器上的文件即可使用

Global site tag (gtag.js) - Google Analytics