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
Copy file name to clipboardExpand all lines: articles/active-directory-domain-services/join-ubuntu-linux-vm.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ Once the VM is deployed, follow the steps to connect to the VM using SSH.
55
55
56
56
To make sure that the VM host name is correctly configured for the managed domain, edit the */etc/hosts* file and set the hostname:
57
57
58
-
```console
58
+
```bash
59
59
sudo vi /etc/hosts
60
60
```
61
61
@@ -66,7 +66,7 @@ In the *hosts* file, update the *localhost* address. In the following example:
66
66
67
67
Update these names with your own values:
68
68
69
-
```console
69
+
```config
70
70
127.0.0.1 ubuntu.aaddscontoso.com ubuntu
71
71
```
72
72
@@ -78,7 +78,7 @@ The VM needs some additional packages to join the VM to the managed domain. To i
78
78
79
79
During the Kerberos installation, the *krb5-user* package prompts for the realm name in ALL UPPERCASE. For example, if the name of your managed domain is *aaddscontoso.com*, enter *AADDSCONTOSO.COM* as the realm. The installation writes the `[realm]` and `[domain_realm]` sections in */etc/krb5.conf* configuration file. Make sure that you specify the realm an ALL UPPERCASE:
@@ -89,13 +89,13 @@ For domain communication to work correctly, the date and time of your Ubuntu VM
89
89
90
90
1. Open the *ntp.conf* file with an editor:
91
91
92
-
```console
92
+
```bash
93
93
sudo vi /etc/ntp.conf
94
94
```
95
95
96
96
1. In the *ntp.conf* file, create a line to add your managed domain's DNS name. In the following example, an entry for *aaddscontoso.com* is added. Use your own DNS name:
97
97
98
-
```console
98
+
```config
99
99
server aaddscontoso.com
100
100
```
101
101
@@ -109,7 +109,7 @@ For domain communication to work correctly, the date and time of your Ubuntu VM
109
109
110
110
Run the following commands to complete these steps. Use your own DNS name with the `ntpdate` command:
111
111
112
-
```console
112
+
```bash
113
113
sudo systemctl stop ntp
114
114
sudo ntpdate aaddscontoso.com
115
115
sudo systemctl start ntp
@@ -121,7 +121,7 @@ Now that the required packages are installed on the VM and NTP is configured, jo
121
121
122
122
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:
123
123
124
-
```console
124
+
```bash
125
125
sudo realm discover AADDSCONTOSO.COM
126
126
```
127
127
@@ -135,13 +135,13 @@ Now that the required packages are installed on the VM and NTP is configured, jo
135
135
136
136
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]`:
@@ -155,7 +155,7 @@ If your VM can't successfully complete the domain-join process, make sure that t
155
155
156
156
If you received the error *Unspecified GSS failure. Minor code may provide more information (Server not found in Kerberos database)*, open the file */etc/krb5.conf* and add the following code in `[libdefaults]` section and try again:
157
157
158
-
```console
158
+
```bash
159
159
rdns=false
160
160
```
161
161
@@ -165,21 +165,21 @@ One of the packages installed in a previous step was for System Security Service
165
165
166
166
1. Open the *sssd.conf* file with an editor:
167
167
168
-
```console
168
+
```bash
169
169
sudo vi /etc/sssd/sssd.conf
170
170
```
171
171
172
172
1. Comment out the line for *use_fully_qualified_names* as follows:
173
173
174
-
```console
174
+
```config
175
175
# use_fully_qualified_names = True
176
176
```
177
177
178
178
When done, save and exit the *sssd.conf* file using the `:wq` command of the editor.
179
179
180
180
1. To apply the change, restart the SSSD service:
181
181
182
-
```console
182
+
```bash
183
183
sudo systemctl restart sssd
184
184
```
185
185
@@ -193,37 +193,37 @@ By default, users can only sign in to a VM using SSH public key-based authentica
193
193
194
194
1. Open the *sshd_conf* file with an editor:
195
195
196
-
```console
196
+
```bash
197
197
sudo vi /etc/ssh/sshd_config
198
198
```
199
199
200
200
1. Update the line for *PasswordAuthentication* to *yes*:
201
201
202
-
```console
202
+
```config
203
203
PasswordAuthentication yes
204
204
```
205
205
206
206
When done, save and exit the *sshd_conf* file using the `:wq` command of the editor.
207
207
208
208
1. To apply the changes and let users sign in using a password, restart the SSH service:
209
209
210
-
```console
210
+
```bash
211
211
sudo systemctl restart ssh
212
212
```
213
213
214
214
### Configure automatic home directory creation
215
215
216
216
To enable automatic creation of the home directory when a user first signs in, complete the following steps:
217
217
218
-
1. Open the */etc/pam.d/common-session* file in an editor:
218
+
1. Open the `/etc/pam.d/common-session` file in an editor:
219
219
220
-
```console
220
+
```bash
221
221
sudo vi /etc/pam.d/common-session
222
222
```
223
223
224
224
1. Add the following line in this file below the line `session optional pam_sss.so`:
@@ -235,13 +235,13 @@ To grant members of the *AAD DC Administrators* group administrative privileges
235
235
236
236
1. Open the *sudoers* file for editing:
237
237
238
-
```console
238
+
```bash
239
239
sudo visudo
240
240
```
241
241
242
242
1. Add the following entry to the end of */etc/sudoers* file:
243
243
244
-
```console
244
+
```config
245
245
# Add 'AAD DC Administrators' group members as admins.
246
246
%AAD\ DC\ Administrators ALL=(ALL) NOPASSWD:ALL
247
247
```
@@ -254,29 +254,29 @@ To verify that the VM has been successfully joined to the managed domain, start
254
254
255
255
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 *ubuntu.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