{"id":611,"date":"2011-07-14T09:05:09","date_gmt":"2011-07-14T09:05:09","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=611"},"modified":"2011-07-14T09:20:09","modified_gmt":"2011-07-14T09:20:09","slug":"ubuntu-11-04-sbs-small-business-server-setup-part-5-%e2%80%93-nfs","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=611","title":{"rendered":"Ubuntu 11.04 SBS (Small Business Server) Setup: Part 5 \u2013 NFS"},"content":{"rendered":"<div id=\"post-496\">\n<div>\n<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>This section will help you configure NFS; using Kerberos to secure it.<\/p>\n<p>The first step is to install the following NFS packages:<\/p>\n<div>\n<div>\n<pre>sudo apt-get install nfs-kernel-server nfs-common<\/pre>\n<\/div>\n<\/div>\n<p>NFSv4 uses a pseudo filesystem by mounting the real directories you want to export under an export folder using the -bind mount option. We need to create this folder system as follows:<\/p>\n<div>\n<div>\n<pre>sudo mkdir \/export\r\nsudo mkdir \/export\/home<\/pre>\n<\/div>\n<\/div>\n<p>In order to mount \/home under \/export\/home each time the system boots, we need to modify \/etc\/fstab by adding the following line to the bottom of the file:<\/p>\n<div>\n<div>\n<pre>\/home    \/export\/home   none    bind  0  0<\/pre>\n<\/div>\n<\/div>\n<p>This will take care of mounting the directories next time he server reboots, but for now we can manually mount it using:<\/p>\n<div>\n<div>\n<pre>sudo mount \/export\/home<\/pre>\n<\/div>\n<\/div>\n<p>Next we\u2019re going to tell NFS what it should export by configuring the \/etc\/exports file like so:<\/p>\n<div>\n<div>\n<pre>\/export *(rw,fsid=0,crossmnt,insecure,async,no_subtree_check,sec=krb5p:krb5i:krb5)\r\n\/export\/home *(rw,insecure,async,no_subtree_check,sec=krb5p:krb5i:krb5)<\/pre>\n<\/div>\n<\/div>\n<p>Now we have to tell NFS to use Kerberos first by setting the following options in \/etc\/default\/nfs-common:<\/p>\n<div>\n<div>\n<pre>NEED_STATD=\r\nSTATDOPTS=\r\nNEED_IDMAPD=yes\r\nNEED_GSSD=yes<\/pre>\n<\/div>\n<\/div>\n<p>Then by setting the following options in \/etc\/default\/nfs-kernel-server:<\/p>\n<div>\n<div>\n<pre>RPCNFSDCOUNT=8\r\nRPCNFSDPRIORITY=0\r\nRPCMOUNTDOPTS=--manage-gids\r\nNEED_SVCGSSD=yes\r\nRPCSVCGSSDOPTS=<\/pre>\n<\/div>\n<\/div>\n<p>\/etc\/idmapd.conf needs to configured with the correct domain name for user\/group name mappings:<\/p>\n<div>\n<div>\n<pre>[General]\r\n\r\nVerbosity = 0\r\nPipefs-Directory = \/var\/lib\/nfs\/rpc_pipefs\r\nDomain = danbishop.org\r\n\r\n[Mapping]\r\n\r\nNobody-User = nobody\r\nNobody-Group = nogroup<\/pre>\n<\/div>\n<\/div>\n<p>Next we need to create Kerberos principals for the NFS server.<\/p>\n<div>\n<div>\n<pre>sudo kadmin.local -q \"addprinc -randkey nfs\/neo.danbishop.org\"\r\nsudo kadmin.local -q \"ktadd nfs\/neo.danbishop.org\"<\/pre>\n<\/div>\n<\/div>\n<p>sudo kadmin.local is used here as you need sudo privileges to write to \/etc\/krb5.keytab.<\/p>\n<p>Finally, a small change is needed to enable weak encryption (the only type currently supported by NFS in Ubuntu) in Kerberos. This is done by editing \/etc\/krb5.conf and adding the following to the [libdefaults] section:<\/p>\n<div>\n<div>\n<pre>allow_weak_crypto = true<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-611","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\/611","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=611"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/611\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}