Skip to content

Commit 453bcd6

Browse files
authored
Merge pull request #134534 from b-juche/live-update-10-19-2020-Kerberos-Doc-Enhancements
updating Configure Kerberos Encryption article
2 parents e5daf72 + 521d7b5 commit 453bcd6

File tree

2 files changed

+190
-36
lines changed

2 files changed

+190
-36
lines changed

articles/azure-netapp-files/configure-kerberos-encryption.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.workload: storage
1313
ms.tgt_pltfrm: na
1414
ms.devlang: na
1515
ms.topic: how-to
16-
ms.date: 9/29/2020
16+
ms.date: 10/19/2020
1717
ms.author: b-juche
1818
---
1919
# Configure NFSv4.1 Kerberos encryption for Azure NetApp Files
@@ -68,9 +68,9 @@ The following requirements apply to NFSv4.1 client encryption:
6868

6969
Configuration of NFSv4.1 Kerberos creates two computer accounts in Active Directory:
7070
* A computer account for SMB shares
71-
* A computer account for NFSv4.1 -- You can identify this account by way of the prefix `NFS-`.
71+
* A computer account for NFSv4.1--You can identify this account by way of the prefix `NFS-`.
7272

73-
After creating the first NFSv4.1 Kerberos volume, set the encryption type or the computer account by using the following PowerShell command:
73+
After creating the first NFSv4.1 Kerberos volume, set the encryption type for the computer account by using the following PowerShell command:
7474

7575
`Set-ADComputer $NFSCOMPUTERACCOUNT -KerberosEncryptionType AES256`
7676

@@ -91,11 +91,11 @@ Follow instructions in [Configure an NFS client for Azure NetApp Files](configur
9191
3. Create the directory (mount point) for the new volume.
9292

9393
4. Set the default encryption type to AES 256 for the computer account:
94-
`Set-ADComputer $COMPUTERACCOUNT -KerberosEncryptionType AES256 -Credential $ANFSERVICEACCOUNT`
94+
`Set-ADComputer $NFSCOMPUTERACCOUNT -KerberosEncryptionType AES256 -Credential $ANFSERVICEACCOUNT`
9595

9696
* You need to run this command only once for each computer account.
9797
* You can run this command from a domain controller or from a PC with [RSAT](https://support.microsoft.com/help/2693643/remote-server-administration-tools-rsat-for-windows-operating-systems) installed.
98-
* The `$COMPUTERACCOUNT` variable is the computer account created in Active Directory when you deploy the Kerberos volume. This is the account that is prefixed with `NFS-`.
98+
* The `$NFSCOMPUTERACCOUNT` variable is the computer account created in Active Directory when you deploy the Kerberos volume. This is the account that is prefixed with `NFS-`.
9999
* The `$ANFSERVICEACCOUNT` variable is a non-privileged Active Directory user account with delegated controls over the Organizational Unit where the computer account has been created.
100100

101101
5. Mount the volume on the host:

articles/azure-netapp-files/configure-nfs-clients.md

Lines changed: 185 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.workload: storage
1313
ms.tgt_pltfrm: na
1414
ms.devlang: na
1515
ms.topic: how-to
16-
ms.date: 09/28/2020
16+
ms.date: 10/19/2020
1717
ms.author: b-juche
1818
---
1919
# Configure an NFS client for Azure NetApp Files
@@ -23,58 +23,212 @@ The NFS client configuration described in this article is part of the setup when
2323
Regardless of the Linux flavor you use, the following configurations are required:
2424
* Configure an NTP client to avoid issues with time skew.
2525
* Configure DNS entries of the Linux client for name resolution.
26-
This configuration includes the “A” (forward) record and the PTR (reverse) record .
27-
* For domain join, create a computer account in the target Active Directory (which is created during the realm join command).
26+
This configuration must include the “A” (forward) record and the PTR (reverse) record .
27+
* For domain join, create a computer account for the Linux client in the target Active Directory (which is created during the realm join command).
2828
> [!NOTE]
2929
> The `$SERVICEACCOUNT` variable used in the commands below should be a user account with permissions or delegation to create a computer account in the targeted Organizational Unit.
30-
* Enable the client to mount NFS volumes and other relevant monitoring tools.
3130
3231
## RHEL 8 configuration
3332

34-
1. Install packages:
35-
`sudo yum -y install realmd sssd adcli samba-common krb5-workstation chrony`
33+
This section describes RHEL configurations required for NFSv4.1 Kerberos encryption and dual protocol.
3634

37-
2. Configure the NTP client:
38-
RHEL 8 uses `chrony` by default. Following the configuration guidelines in [Using the Chrony suite to configure NTP](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/using-chrony-to-configure-ntp).
35+
The examples in this section use the following domain name and IP address:
3936

40-
3. Join the Active Directory domain:
41-
`sudo realm join $DOMAIN.NAME -U $SERVICEACCOUNT --computer-ou= OU=$YOUROU,DC=$DOMAIN,DC=TLD`
37+
* Domain name: `contoso.com`
38+
* Private IP: `10.6.1.4`
4239

43-
## Ubuntu configuration
44-
This section describes Ubuntu configuration for the NFS clients.
40+
### <a name="rhel8_nfsv41_kerberos"></a>RHEL 8 configuration if you are using NFSv4.1 Kerberos encryption
4541

46-
### If you are using NFSv4.1 Kerberos encryption
42+
1. Configure `/etc/resolv.conf` with the proper DNS server.
4743

48-
1. Install packages:
49-
`sudo yum -y install realmd packagekit sssd adcli samba-common krb5-workstation chrony`
44+
For example:
5045

51-
2. Configure the NTP client.
52-
Ubuntu 18.04 uses `chrony` by default. Following the configuration guidelines in [Ubuntu Bionic: Using chrony to configure NTP](https://ubuntu.com/blog/ubuntu-bionic-using-chrony-to-configure-ntp).
46+
`[root@reddoc cbs]# cat /etc/resolv.conf`
47+
`search contoso.com`
48+
`nameserver 10.6.1.4(private IP)`
5349

54-
3. Join the Active Directory Domain:
55-
`sudo realm join $DOMAIN.NAME -U $SERVICEACCOUNT --computer-ou= OU=$YOUROU,DC=$DOMAIN,DC=TLD`
50+
2. Add the NFS client record in the DNS server for the DNS forward and reverse lookup zone.
5651

57-
### If you are using dual protocol
52+
3. To verify DNS, use the following commands from the NFS client:
5853

59-
1. Run the following command to upgrade the installed packages:
60-
`sudo apt update && sudo apt install libnss-ldap libpam-ldap ldap-utils nscd`
54+
`# nslookup [hostname/FQDN of NFS client(s)]`
55+
`# nslookup [IP address of NFS client(s)]`
56+
57+
4. Install packages:
58+
59+
`yum update`
60+
`sudo yum -y install realmd sssd adcli samba-common krb5-workstation chrony nfs-utils`
61+
62+
5. Configure the NTP client.
63+
64+
RHEL 8 uses chrony by default. Following the configuration guidelines in [Using the `Chrony` suite to configure NTP](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/using-chrony-to-configure-ntp).
65+
66+
6. Join the Active Directory domain:
67+
68+
`sudo realm join $DOMAIN.NAME -U $SERVICEACCOUNT --computer-ou="OU=$YOUROU"`
69+
70+
For example:
71+
72+
`sudo realm join CONTOSO.COM -U ad_admin --computer-ou="CN=Computers"`
73+
74+
75+
7. Restart all NFS services:
76+
77+
`systemctl start nfs-*`
78+
`systemctl restart rpc-gssd.service`
79+
80+
The restart prevents the error condition `“mount.nfs: an incorrect mount option was specified”` during Kerberos mount.
81+
82+
8. Run the `kinit` command with the user account to get tickets:
83+
84+
`sudo kinit $SERVICEACCOUNT@DOMAIN`
85+
86+
For example:
87+
88+
`sudo kinit [email protected]`
89+
90+
91+
### RHEL 8 configuration if you are using dual protocol
92+
93+
The following steps are optional. You need to perform the steps only if you use user mapping at the NFS client:
94+
95+
1. Complete all steps described in the [RHEL 8 configuration if you are using NFSv4.1 Kerberos encryption](#rhel8_nfsv41_kerberos) section.
6196

62-
Example:
97+
2. Add a static DNS record in your /etc/hosts file to use fully qualified domain name (FQDN) for your AD, instead of using the IP address in SSSD configuration file:
6398

64-
`base dc=hariscus,dc=com`
65-
`uri ldap://10.20.0.4:389/`
66-
`ldap_version 3`
67-
`rootbinddn cn=admin,cn=Users,dc=hariscus,dc=com`
68-
`pam_password ad`
99+
`cat /etc/hosts`
100+
`10.6.1.4 winad2016.contoso.com`
101+
102+
3. Add an extra section for domains to resolve identifiers from AD LDAP server:
103+
104+
`[root@reddoc cbs]# cat /etc/sssd/sssd.conf`
105+
`[sssd]`
106+
`domains = contoso.com, contoso-ldap (new entry added for LDAP as id_provider)`
107+
`config_file_version = 2`
108+
`services = nss, pam, ssh, sudo (ensure nss is present in this list)`
109+
110+
`[domain/contoso-ldap] (Copy the following lines. Modify as per your domain name.)`
111+
`auth_provider = krb5`
112+
`chpass_provider = krb5`
113+
`id_provider = ldap`
114+
`ldap_search_base = dc=contoso,dc=com(your domain)`
115+
`ldap_schema = rfc2307bis`
116+
`ldap_sasl_mech = GSSAPI`
117+
`ldap_user_object_class = user`
118+
`ldap_group_object_class = group`
119+
`ldap_user_home_directory = unixHomeDirectory`
120+
`ldap_user_principal = userPrincipalName`
121+
`ldap_account_expire_policy = ad`
122+
`ldap_force_upper_case_realm = true`
123+
`ldap_user_search_base = cn=Users,dc=contoso,dc=com (based on your domain)`
124+
`ldap_group_search_base = cn=Users,dc=contoso,dc=com (based on your domain)`
125+
`ldap_sasl_authid = REDDOC$ (ensure $ at the end you can get this from “klist -kte” command)`
126+
`krb5_server = winad2016.contoso.com (same as AD address which is added in /etc/hosts)`
127+
`krb5_realm = CONTOSO.COM (domain name in caps)`
128+
`krb5_kpasswd = winad2016.contoso.com (same as AD address which is added in /etc/hosts)`
129+
`use_fully_qualified_names = false`
130+
131+
`[domain/contoso.com] (Do not edit or remove any of the following information. This information is automatically generated during the realm join process.)`
132+
`ad_domain = contoso.com`
133+
`krb5_realm = CONTOSO.COM`
134+
`realmd_tags = manages-system joined-with-adcli`
135+
`cache_credentials = True`
136+
`id_provider = ad`
137+
`krb5_store_password_if_offline = True`
138+
`default_shell = /bin/bash`
139+
`ldap_id_mapping = True`
140+
`use_fully_qualified_names = True`
141+
`fallback_homedir = /home/%u@%d`
142+
`access_provider = ad`
143+
144+
4. Ensure your `/etc/nsswitch.conf` has the `sss` entry:
145+
146+
`cat /etc/nsswitch.conf`
147+
`passwd: sss files systemd`
148+
`group: sss files systemd`
149+
`netgroup: sss files`
150+
151+
5. Restart the `sssd` service and clear cache:
152+
153+
`service sssd stop`
154+
`rm -f /var/lib/sss/db/*`
155+
`service sssd start`
69156

70-
2. Run the following command to restart and enable the service:
71-
`sudo systemctl restart nscd && sudo systemctl enable nscd`
157+
6. Test to ensure that your client is integrated with the LDAP server:
158+
159+
`[root@red81 cbs]# id ldapuser1`
160+
`uid=1234(ldapuser1) gid=1111(ldapgroup1) groups=1111(ldapgroup1)`
161+
162+
## Ubuntu configuration
163+
164+
This section describes Ubuntu configurations required for NFSv4.1 Kerberos encryption and dual protocol.
72165

73-
The following example queries the AD LDAP server from Ubuntu LDAP client for an LDAP user `ldapu1`:
166+
The examples in this section use the following domain name and IP address:
167+
168+
* Domain name: `contoso.com`
169+
* Private IP: `10.6.1.4`
170+
171+
1. Configure `/etc/resolv.conf` with the proper DNS server:
172+
173+
`root@ubuntu-rak:/home/cbs# cat /etc/resolv.conf`
174+
`search contoso.com`
175+
`nameserver <private IP address of DNS server>`
176+
177+
2. Add NFS client record in the DNS server for the DNS forward and reverse lookup zone.
178+
179+
To verify DNS, use the following commands from the NFS client:
180+
181+
`# nslookup [hostname/FQDN of NFS client(s)]`
182+
`# nslookup [IP address of NFS client(s)]`
183+
184+
3. Install packages:
185+
186+
`apt-get update`
187+
`apt-get install -y realmd packagekit sssd adcli samba-common chrony krb5-user nfs-common`
188+
189+
When prompted, input `$DOMAIN.NAME` (using uppercase, for example, `CONTOSO.COM`) as the default Kerberos realm.
190+
191+
4. Restart the service `rpc-gssd.service`:
192+
193+
`sudo systemctl start rpc-gssd.service`
194+
195+
5. Ubuntu 18.04 uses chrony by default. Following the configuration guidelines in [Ubuntu Bionic: Using chrony to configure NTP](https://ubuntu.com/blog/ubuntu-bionic-using-chrony-to-configure-ntp).
196+
197+
6. Join the Active Directory Domain:
198+
199+
`sudo realm join $DOMAIN.NAME -U $SERVICEACCOUNT --computer-ou="OU=$YOUROU"`
200+
201+
For example:
202+
`sudo realm join CONTOSO.COM -U ad_admin --computer-ou="CN=Computers"`
203+
204+
7. Perform `kinit` with the user to get tickets:
205+
206+
`sudo kinit $SERVICEACCOUNT`
207+
208+
For example:
209+
`sudo kinit ad_admin`
210+
211+
### Ubuntu configuration if you are using dual protocol
212+
213+
The following steps are optional. You need to perform the steps only if you want to use user mapping at the NFS client:
214+
215+
1. Run the following command to upgrade the installed packages:
216+
`sudo apt update && sudo apt install libnss-ldap libpam-ldap ldap-utils nscd`
217+
218+
The following example uses sample values. When the command prompts you for input, you should provide input based on your environment.
219+
220+
`base dc=contoso,dc=com uri ldap://10.20.0.4:389/ ldap_version 3 rootbinddn cn=admin,cn=Users,dc=contoso,dc=com pam_password ad`
221+
222+
2. Run the following command to restart and enable the service:
223+
224+
`sudo systemctl restart nscd && sudo systemctl enable nscd`
225+
226+
The following example queries the AD LDAP server from Ubuntu LDAP client for an LDAP user `‘hari1’`:
74227

75228
`root@cbs-k8s-varun4-04:/home/cbs# getent passwd hari1`
76229
`hari1:*:1237:1237:hari1:/home/hari1:/bin/bash`
77230

231+
78232
## Next steps
79233

80234
* [Create an NFS volume for Azure NetApp Files](azure-netapp-files-create-volumes.md)

0 commit comments

Comments
 (0)