{"id":1065,"date":"2010-11-18T21:31:39","date_gmt":"2010-11-18T21:31:39","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?p=1065"},"modified":"2011-04-18T14:50:07","modified_gmt":"2011-04-18T13:50:07","slug":"kerberos-realms-usage","status":"publish","type":"post","link":"http:\/\/darenmatthews.com\/blog\/?p=1065","title":{"rendered":"Kerberos Realms Usage"},"content":{"rendered":"<div id=\"vcc_sp_div_24\">\n<p>In order to authenticate against Kerberos realms and perform remote administration, the system must have the <em id=\"vcc_sp_em_26\">krb5-workstation<\/em> package installed.<!--more--><\/p>\n<div id=\"vcc_sp_div_27\">\n<h2 id=\"vcc_sp_h2_28\">Adding principals with kadmin<\/h2>\n<p id=\"vcc_sp_p_29\">Use <strong id=\"vcc_sp_strong_30\">kadmin<\/strong> to add and manage principals. The example below creates a principal for  <em id=\"vcc_sp_em_31\">testuser@MYREALM<\/em>:<\/p>\n<pre id=\"vcc_sp_pre_32\">[root@kdc ~]# <strong id=\"vcc_sp_strong_33\">\/usr\/kerberos\/sbin\/kadmin -p root\/admin@MYREALM \\<\/strong>\r\n              <strong id=\"vcc_sp_strong_34\">-q 'add_principal testuser@MYREALM'<\/strong>\r\nAuthenticating as principal root\/admin@MYREALM with password.\r\nPassword for root\/admin@MYREALM:principalpass\r\nWARNING: no policy specified for testuser@MYREALM; defaulting to no policy\r\nEnter password for principal \"testuser@MYREALM\":<strong id=\"vcc_sp_strong_35\">testuser<\/strong>\r\nRe-enter password for principal \"testuser@MYREALM\":<strong id=\"vcc_sp_strong_36\">testuser<\/strong>\r\nPrincipal \"testuser@MYREALM\" created.\r\n[root@kdc ~]#<\/pre>\n<div id=\"vcc_sp_div_37\"><span id=\"vcc_sp_span_38\">Note:<\/span> The password for the <em id=\"vcc_sp_em_39\">root\/admin@MYREALM<\/em> principal was defined at the time of it&#8217;s creation in the previous subsection.<\/div>\n<\/div>\n<div id=\"vcc_sp_div_40\">\n<h2 id=\"vcc_sp_h2_41\">Authenticating a principal<\/h2>\n<p id=\"vcc_sp_p_42\">Use <strong id=\"vcc_sp_strong_43\">kinit<\/strong> to request a <em id=\"vcc_sp_em_44\">Ticket-Granting Ticket<\/em> (TGT), <strong id=\"vcc_sp_strong_45\">klist<\/strong> to list current tickets, and <strong id=\"vcc_sp_strong_46\">kdestroy<\/strong> to destroy the credential cache:<\/p>\n<pre id=\"vcc_sp_pre_47\">[root@host ~]# <strong id=\"vcc_sp_strong_48\">klist<\/strong>\r\nklist: No credentials cache found (ticket cache FILE:\/tmp\/krb5cc_0)\r\n\r\nKerberos 4 ticket cache: \/tmp\/tkt0\r\nklist: You have no tickets cached\r\n[root@host ~]# <strong id=\"vcc_sp_strong_49\">kinit testuser@MYREALM<\/strong>\r\nPassword for testuser@MYREALM:<strong id=\"vcc_sp_strong_50\">principalpass<\/strong>\r\n[root@host ~]# <strong id=\"vcc_sp_strong_51\">klist<\/strong>\r\nTicket cache: FILE:\/tmp\/krb5cc_0\r\nDefault principal: testuser@MYREALM\r\n\r\nValid starting     Expires            Service principal\r\n10\/03\/08 09:34:06  10\/04\/08 09:34:06  <strong id=\"vcc_sp_strong_52\">krbtgt\/MYREALM@MYREALM<\/strong>\r\n\r\nKerberos 4 ticket cache: \/tmp\/tkt0\r\nklist: You have no tickets cached\r\n[root@host ~]# <strong id=\"vcc_sp_strong_53\">kdestroy<\/strong>\r\n[root@host ~]# <strong id=\"vcc_sp_strong_54\">klist<\/strong>\r\nklist: No credentials cache found (ticket cache FILE:\/tmp\/krb5cc_0)\r\n\r\nKerberos 4 ticket cache: \/tmp\/tkt0\r\nklist: You have no tickets cached\r\n[root@host ~]#<\/pre>\n<div id=\"vcc_sp_div_55\"><span id=\"vcc_sp_span_56\">Note:<\/span> The password for the <em id=\"vcc_sp_em_57\">testuser@MYREALM<\/em> principal was defined in the previous section. The example above can be executed on any host that was previously configured as a client for the <em id=\"vcc_sp_em_58\">MYREALM<\/em> realm.<\/div>\n<\/div>\n<div id=\"vcc_sp_div_59\">\n<h2 id=\"vcc_sp_h2_60\">Configuring the system for Single Sign-on using Kerberos<\/h2>\n<p id=\"vcc_sp_p_61\">The configuration for a Single Sign-on solution using Kerberos is not the primary objective of this writing, but there are a few points that are worth noting when pursuing such environment, listed:<\/p>\n<ul id=\"vcc_sp_ul_62\">\n<li id=\"vcc_sp_li_63\">For complete instructions, refer to the RedHat Enterprise Linux 5 Deployment Guide, section 42.6.6 &#8211; <a id=\"vcc_sp_a_64\" tabindex=\"43\" href=\"http:\/\/www.redhat.com\/docs\/manuals\/enterprise\/RHEL-5-manual\/Deployment_Guide-en-US\/s1-kerberos-clients.html\" target=\"_blank\">Configuring a Kerberos 5 Client<\/a> onwards (http:\/\/www.redhat.com\/docs\/manuals\/enterprise\/RHEL-5-manual\/Deployment_Guide-en-US\/s1-kerberos-clients.html)<\/li>\n<li id=\"vcc_sp_li_65\">Kerberos passwords (or <em id=\"vcc_sp_em_66\">keys<\/em>) are independent of the standard <em id=\"vcc_sp_em_67\">Unix<\/em> password database (<em id=\"vcc_sp_em_68\">\/etc\/passwd<\/em> or <em id=\"vcc_sp_em_69\">\/etc\/shadow<\/em>). There is generally no automated way of migrating between each other.<\/li>\n<li id=\"vcc_sp_li_70\">The best way of implementing Single Sign-on is by using the <em id=\"vcc_sp_em_71\">pam_krb5<\/em>. so PAM module (provided in the <em id=\"vcc_sp_em_72\">pam_krb5<\/em> package). The <em id=\"vcc_sp_em_73\">pam_krb5<\/em> module can be both stacked as <em id=\"vcc_sp_em_74\">sufficient<\/em> authentication with other authentication modules or enforced as required authentication. By authenticating against <em id=\"vcc_sp_em_75\">pam_krb5<\/em>, the user should receive valid Kerberos credentials which will be cached per-session in the client (as if <em id=\"vcc_sp_em_76\">kinit<\/em> was invoked).<\/li>\n<li id=\"vcc_sp_li_77\">In a Kerberos Single Sign-on environment, it is of utter importance that the users are not allowed to perform authentication (using their Kerberos password) in non-Kerberos systems, such as <em id=\"vcc_sp_em_78\">telnet<\/em> and <em id=\"vcc_sp_em_79\">ftp<\/em>. Instead, the <em id=\"vcc_sp_em_80\">Kerberized<\/em> versions for these basic services (bundled with the <em id=\"vcc_sp_em_81\">krb5-workstation<\/em> package) should be used.<\/li>\n<li id=\"vcc_sp_li_82\">For other services such as SSH and IMAP, use the GSS (<em id=\"vcc_sp_em_83\">General Security Services<\/em>) enabled servers. SSH in particular needs GSS-API enabled in both client and server configurations, and the ability to reverse-resolve IP addresses to hostnames.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div id=\"vcc_sp_div_84\">\n<div id=\"vcc_sp_div_85\">\n<div id=\"vcc_sp_div_86\"><strong id=\"vcc_sp_strong_87\">Parent topic:<\/strong> <a id=\"vcc_sp_a_88\" title=\"After setting up the Tivoli Directory Server with the Kerberos Schema, a suffix and related entries, and SSL connection, it is time to set up the counterpart Kerberos KDC server to correctly connect to the Directory Server and perform the initial Kerberos Realm set up.\" tabindex=\"67\" href=\"http:\/\/publib.boulder.ibm.com\/infocenter\/lnxinfo\/v3r0m0\/topic\/liaai\/kerberos\/liaaikerbkdcserver.htm\">Setting up the Kerberos KDC Server<\/a><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In order to authenticate against Kerberos realms and perform remote administration, the system must have the krb5-workstation package installed.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[54,4],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1065"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1065"}],"version-history":[{"count":8,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1065\/revisions"}],"predecessor-version":[{"id":1258,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1065\/revisions\/1258"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1065"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}