{"id":609,"date":"2011-07-14T09:03:11","date_gmt":"2011-07-14T09:03:11","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=609"},"modified":"2011-07-14T09:19:54","modified_gmt":"2011-07-14T09:19:54","slug":"ubuntu-11-04-sbs-small-business-server-setup-part-4-%e2%80%93-kerberos","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=609","title":{"rendered":"Ubuntu 11.04 SBS (Small Business Server) Setup: Part 4 \u2013 Kerberos"},"content":{"rendered":"<p>This is part of a guide to setting up Ubuntu Server Edition 11.04 for a small\/medium business. The server will provide DHCP, DNS, NTP, LDAP, Kerberos and NFS services such that users can login to any machine on the network and all their files and settings will be the same across the entire network.<\/p>\n<p><a title=\"Ubuntu 11.04 SBS (Small Business Server) Setup: Part 1 \u2013 DHCP and DNS\" href=\"https:\/\/blog.designed79.co.uk\/?p=601\">Part 1 &#8211;\u00a0DHCP and DNS<\/a><\/p>\n<p><a title=\"Ubuntu 11.04 SBS (Small Business Server) Setup: Part 2 \u2013 NTP\" href=\"https:\/\/blog.designed79.co.uk\/?p=605\">Part 2 &#8211; NTP<\/a><\/p>\n<p><a title=\"Ubuntu 11.04 SBS (Small Business Server) Setup: Part 3 \u2013 OpenLDAP\" href=\"https:\/\/blog.designed79.co.uk\/?p=607\">Part 3 &#8211; OpenLDAP<\/a><\/p>\n<p><a title=\"Ubuntu 11.04 SBS (Small Business Server) Setup: Part 4 \u2013 Kerberos\" href=\"https:\/\/blog.designed79.co.uk\/?p=609\">Part 4 &#8211; Kerberos<\/a><\/p>\n<p><a title=\"Ubuntu 11.04 SBS (Small Business Server) Setup: Part 5 \u2013 NFS\" href=\"https:\/\/blog.designed79.co.uk\/?p=611\">Part 5 &#8211; NFS<\/a><\/p>\n<p><a title=\"Ubuntu 11.04 SBS (Small Business Server) Setup: Part 6 \u2013 Account Management\" href=\"https:\/\/blog.designed79.co.uk\/?p=613\">Part 6 &#8211; Account Management<\/a><\/p>\n<p><a title=\"Ubuntu 11.04 SBS (Small Business Server) Setup: Part 7 \u2013 Setting Up Clients\" href=\"https:\/\/blog.designed79.co.uk\/?p=615\">Part 7 &#8211; Setting Up Clients<\/a><\/p>\n<p>It\u2019s time to install and configure Kerberos.<\/p>\n<div>\n<div>\n<pre>sudo apt-get install krb5-kdc krb5-admin-server<\/pre>\n<\/div>\n<\/div>\n<p>The packages will automatically configure Kerberos for the correct realm from the information provided by Dnsmasq earlier in this guide. All we have to do is create the database for the realm using the following tool:<\/p>\n<div>\n<div>\n<pre>sudo krb5_newrealm<\/pre>\n<\/div>\n<\/div>\n<p>There will be a slight delay whilst the server gathers enough random data to continue, then you will be asked to enter a master key for Kerberos, make sure you use something secure and memorable.<\/p>\n<p>To configure Kerberos for NFS later, we\u2019ll need to create an admin user.<\/p>\n<div>\n<div>\n<pre>sudo kadmin.local<\/pre>\n<\/div>\n<\/div>\n<p>The following output should be observed:<\/p>\n<div>\n<div>\n<pre>Authenticating as principal root\/admin@DANBISHOP.ORG with password.\r\nkadmin.local:<\/pre>\n<\/div>\n<\/div>\n<p>Enter the following:<\/p>\n<div>\n<div>\n<pre>addprinc dan\/admin<\/pre>\n<\/div>\n<\/div>\n<p>Enter a password when prompted, then quit:<\/p>\n<div>\n<div>\n<pre>WARNING: no policy specified for dan\/admin@DANBISHOP.ORG; defaulting to no policy\r\nEnter password for principal \"dan\/admin@DANBISHOP.ORG\":\r\nRe-enter password for principal \"dan\/admin@DANBISHOP.ORG\":\r\nPrincipal \"dan\/admin@DANBISHOP.ORG\" created.\r\nkadmin.local: quit<\/pre>\n<\/div>\n<\/div>\n<p>We need to give dan\/admin admin privileges by editing the access control list for Kerberos (\/etc\/krb5kdc\/kadm5.acl) this file should contain the following:<\/p>\n<div>\n<div>\n<pre># This file Is the access control list for krb5 administration.\r\n# When this file is edited run \/etc\/init.d\/krb5-admin-server restart to activate\r\n# One common way to set up Kerberos administration is to allow any principal\r\n# ending in \/admin  is given full administrative rights.\r\n# To enable this, uncomment the following line:\r\n*\/admin *<\/pre>\n<\/div>\n<\/div>\n<p>Note that the last line has been uncommented so that all \/admin principals have admin rights. To get Kerberos to use the new ACL we need to restart it:<\/p>\n<div>\n<div>\n<pre>sudo service krb5-admin-server restart<\/pre>\n<\/div>\n<\/div>\n<p>Now we can test everything has worked with:<\/p>\n<div>\n<div>\n<pre>kinit dan\/admin<\/pre>\n<\/div>\n<\/div>\n<p>Enter the password you set when requested then run klist:<\/p>\n<div>\n<div>\n<pre>klist\r\nTicket cache: FILE:\/tmp\/krb5cc_1000\r\nDefault principal: dan\/admin@DANBISHOP.ORG\r\n\r\nValid starting     Expires            Service principal\r\n02\/05\/11 19:57:24  02\/06\/11 05:57:24  krbtgt\/DANBISHOP.ORG@DANBISHOP.ORG\r\n\trenew until 02\/06\/11 19:57:21<\/pre>\n<\/div>\n<\/div>\n<p>If you get output something like the above then congratulations, you have a fully functioning Kerberos Realm\u00a0<img decoding=\"async\" src=\"http:\/\/www.danbishop.org\/wp-includes\/images\/smilies\/icon_smile.gif\" alt=\":)\" \/><\/p>\n<p>Finally, we can enable kerberos authentication to login to the server.<\/p>\n<div>\n<div>\n<pre>sudo apt-get install libpam-krb5\r\nsudo pam-auth-update<\/pre>\n<\/div>\n<\/div>\n<p>Check that Kerberos and LDAP are selected as authentication methods to allow users to login\/ssh into the server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is part of a guide to setting up Ubuntu Server Edition 11.04 for a small\/medium business. The server will provide DHCP, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-609","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=609"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/609\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}