You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,7 +54,7 @@ Once the VM is deployed, follow the steps to connect to the VM using SSH.
54
54
55
55
To make sure that the VM host name is correctly configured for the managed domain, edit the */etc/hosts* file and set the hostname:
56
56
57
-
```console
57
+
```bash
58
58
sudo vi /etc/hosts
59
59
```
60
60
@@ -65,74 +65,36 @@ In the *hosts* file, update the *localhost* address. In the following example:
65
65
66
66
Update these names with your own values:
67
67
68
-
```console
68
+
```config
69
69
127.0.0.1 rhel rhel.aaddscontoso.com
70
70
```
71
71
72
72
When done, save and exit the *hosts* file using the `:wq` command of the editor.
73
73
74
-
## Install required packages
75
74
76
-
The VM needs some additional packages to join the VM to the managed domain. To install and configure these packages, update and install the domain-join tools using `yum`. There are some differences between RHEL 7.x and RHEL 6.x, so use the appropriate commands for your distro version in the remaining sections of this article.
> Keep in consideration Red Hat Enterprise Linux 6.X and Oracle Linux 6.x is already EOL.
80
+
> RHEL 6.10 has available [ELS support](https://www.redhat.com/en/resources/els-datasheet), which [will end on 06/2024](https://access.redhat.com/product-life-cycles/?product=Red%20Hat%20Enterprise%20Linux,OpenShift%20Container%20Platform%204).
83
81
84
-
**RHEL 6**
82
+
## Install required packages
85
83
86
-
```console
84
+
The VM needs some additional packages to join the VM to the managed domain. To install and configure these packages, update and install the domain-join tools using `yum`.
Now that the required packages are installed on the VM, join the VM to the managed domain. Again, use the appropriate steps for your RHEL distro version.
93
-
94
-
### RHEL 7
95
-
96
-
1. Use the `realm discover` command to discover the managed domain. The following example discovers the realm *AADDSCONTOSO.COM*. Specify your own managed domain name in ALL UPPERCASE:
97
-
98
-
```console
99
-
sudo realm discover AADDSCONTOSO.COM
100
-
```
101
-
102
-
If the `realm discover` command can't find your managed domain, review the following troubleshooting steps:
103
-
104
-
* Make sure that the domain is reachable from the VM. Try `ping aaddscontoso.com` to see if a positive reply is returned.
105
-
* Check that the VM is deployed to the same, or a peered, virtual network in which the managed domain is available.
106
-
* Confirm that the DNS server settings for the virtual network have been updated to point to the domain controllers of the managed domain.
107
-
108
-
1. Now initialize Kerberos using the `kinit` command. Specify a user that's a part of the managed domain. If needed, [add a user account to a group in Azure AD](../active-directory/fundamentals/active-directory-groups-members-azure-portal.md).
109
-
110
-
Again, the managed domain name must be entered in ALL UPPERCASE. In the following example, the account named `[email protected]` is used to initialize Kerberos. Enter your own user account that's a part of the managed domain:
1. Finally, join the VM to the managed domain using the `realm join` command. Use the same user account that's a part of the managed domain that you specified in the previous `kinit` command, such as `[email protected]`:
It takes a few moments to join the VM to the managed domain. The following example output shows the VM has successfully joined to the managed domain:
123
-
124
-
```output
125
-
Successfully enrolled machine in realm
126
-
```
127
-
128
-
### RHEL 6
91
+
Now that the required packages are installed on the VM, join the VM to the managed domain.
129
92
130
93
1. Use the `adcli info` command to discover the managed domain. The following example discovers the realm *ADDDSCONTOSO.COM*. Specify your own managed domain name in ALL UPPERCASE:
131
94
132
-
```console
95
+
```bash
133
96
sudo adcli info aaddscontoso.com
134
97
```
135
-
136
98
If the `adcli info`command can't find your managed domain, review the following troubleshooting steps:
137
99
138
100
* Make sure that the domain is reachable from the VM. Try `ping aaddscontoso.com` to see if a positive reply is returned.
@@ -141,22 +103,22 @@ Successfully enrolled machine in realm
141
103
142
104
1. First, join the domain using the `adcli join` command, this command also creates the keytab to authenticate the machine. Use a user account that's a part of the managed domain.
143
105
144
-
```console
106
+
```bash
145
107
sudo adcli join aaddscontoso.com -U contosoadmin
146
108
```
147
109
148
110
1. Now configure the `/ect/krb5.conf` and create the `/etc/sssd/sssd.conf` files to use the `aaddscontoso.com` Active Directory domain.
149
111
Make sure that `AADDSCONTOSO.COM` is replaced by your own domain name:
150
112
151
-
Open the `/ect/krb5.conf` file with an editor:
113
+
Open the `/etc/krb5.conf` file with an editor:
152
114
153
-
```console
115
+
```bash
154
116
sudo vi /etc/krb5.conf
155
117
```
156
118
157
119
Update the `krb5.conf` file to match the following sample:
158
120
159
-
```console
121
+
```config
160
122
[logging]
161
123
default = FILE:/var/log/krb5libs.log
162
124
kdc = FILE:/var/log/krb5kdc.log
@@ -183,13 +145,13 @@ Successfully enrolled machine in realm
183
145
184
146
Create the `/etc/sssd/sssd.conf` file:
185
147
186
-
```console
148
+
```bash
187
149
sudo vi /etc/sssd/sssd.conf
188
150
```
189
151
190
152
Update the `sssd.conf` file to match the following sample:
191
153
192
-
```console
154
+
```config
193
155
[sssd]
194
156
services = nss, pam, ssh, autofs
195
157
config_file_version = 2
@@ -202,20 +164,20 @@ Successfully enrolled machine in realm
202
164
203
165
1. Make sure `/etc/sssd/sssd.conf` permissions are 600 and is owned by root user:
204
166
205
-
```console
167
+
```bash
206
168
sudo chmod 600 /etc/sssd/sssd.conf
207
169
sudo chown root:root /etc/sssd/sssd.conf
208
170
```
209
171
210
172
1. Use `authconfig` to instruct the VM about the AD Linux integration:
@@ -224,7 +186,7 @@ If your VM can't successfully complete the domain-join process, make sure that t
224
186
225
187
Now check if you can query user AD information using `getent`
226
188
227
-
```console
189
+
```bash
228
190
sudo getent passwd contosoadmin
229
191
```
230
192
@@ -234,45 +196,108 @@ By default, users can only sign in to a VM using SSH public key-based authentica
234
196
235
197
1. Open the *sshd_conf* file with an editor:
236
198
237
-
```console
199
+
```bash
238
200
sudo vi /etc/ssh/sshd_config
239
201
```
240
202
241
203
1. Update the line for*PasswordAuthentication* to *yes*:
242
204
243
-
```console
205
+
```config
244
206
PasswordAuthentication yes
245
207
```
246
208
247
209
When done, save and exit the *sshd_conf* file using the `:wq`command of the editor.
248
210
249
211
1. To apply the changes and let users sign in using a password, restart the SSH service for your RHEL distro version:
250
212
251
-
**RHEL 7**
213
+
```bash
214
+
sudo service sshd restart
215
+
```
216
+
252
217
253
-
```console
254
-
sudo systemctl restart sshd
218
+
# [RHEL 7](#tab/rhel7)
219
+
220
+
## Install required packages
221
+
222
+
The VM needs some additional packages to join the VM to the managed domain. To install and configure these packages, update and install the domain-join tools using `yum`.
Now that the required packages are installed on the VM, join the VM to the managed domain. Again, use the appropriate steps for your RHEL distro version.
230
+
231
+
1. Use the `realm discover`command to discover the managed domain. The following example discovers the realm *AADDSCONTOSO.COM*. Specify your own managed domain name in ALL UPPERCASE:
232
+
233
+
```bash
234
+
sudo realm discover AADDSCONTOSO.COM
255
235
```
256
236
257
-
**RHEL 6**
237
+
If the `realm discover`command can't find your managed domain, review the following troubleshooting steps:
258
238
259
-
```console
260
-
sudo service sshd restart
239
+
* Make sure that the domain is reachable from the VM. Try `ping aaddscontoso.com` to see if a positive reply is returned.
240
+
* Check that the VM is deployed to the same, or a peered, virtual network in which the managed domain is available.
241
+
* Confirm that the DNS server settings for the virtual network have been updated to point to the domain controllers of the managed domain.
242
+
243
+
1. Now initialize Kerberos using the `kinit` command. Specify a user that's a part of the managed domain. If needed, [add a user account to a group in Azure AD](../active-directory/fundamentals/active-directory-groups-members-azure-portal.md).
244
+
245
+
Again, the managed domain name must be entered in ALL UPPERCASE. In the following example, the account named `[email protected]` is used to initialize Kerberos. Enter your own user account that's a part of the managed domain:
1. Finally, join the VM to the managed domain using the `realm join` command. Use the same user account that's a part of the managed domain that you specified in the previous `kinit` command, such as `[email protected]`:
It takes a few moments to join the VM to the managed domain. The following example output shows the VM has successfully joined to the managed domain:
258
+
259
+
```output
260
+
Successfully enrolled machine in realm
261
+
```
262
+
263
+
## Allow password authentication for SSH
264
+
265
+
By default, users can only sign in to a VM using SSH public key-based authentication. Password-based authentication fails. When you join the VM to a managed domain, those domain accounts need to use password-based authentication. Update the SSH configuration to allow password-based authentication as follows.
266
+
267
+
1. Open the *sshd_conf* file with an editor:
268
+
269
+
```bash
270
+
sudo vi /etc/ssh/sshd_config
261
271
```
262
272
273
+
1. Update the line for*PasswordAuthentication* to *yes*:
274
+
275
+
```bash
276
+
PasswordAuthentication yes
277
+
```
278
+
279
+
When done, save and exit the *sshd_conf* file using the `:wq`command of the editor.
280
+
281
+
1. To apply the changes and let users sign in using a password, restart the SSH service.
282
+
283
+
```bash
284
+
sudo systemctl restart sshd
285
+
```
286
+
---
287
+
263
288
## Grant the 'AAD DC Administrators' group sudo privileges
264
289
265
290
To grant members of the *AAD DC Administrators* group administrative privileges on the RHEL VM, you add an entry to the */etc/sudoers*. Once added, members of the *AAD DC Administrators* group can use the `sudo`command on the RHEL VM.
266
291
267
292
1. Open the *sudoers* file for editing:
268
293
269
-
```console
294
+
```bash
270
295
sudo visudo
271
296
```
272
297
273
298
1. Add the following entry to the end of */etc/sudoers* file. The *AAD DC Administrators* group contains whitespace in the name, so include the backslash escape character in the group name. Add your own domain name, such as *aaddscontoso.com*:
274
299
275
-
```console
300
+
```config
276
301
# Add 'AAD DC Administrators' group members as admins.
@@ -285,29 +310,29 @@ To verify that the VM has been successfully joined to the managed domain, start
285
310
286
311
1. Create a new SSH connection from your console. Use a domain account that belongs to the managed domain using the `ssh -l` command, such as `[email protected]` and then enter the address of your VM, such as *rhel.aaddscontoso.com*. If you use the Azure Cloud Shell, use the public IP address of the VM rather than the internal DNS name.
0 commit comments