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-centos-linux-vm.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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,7 +65,7 @@ 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 centos.aaddscontoso.com centos
70
70
```
71
71
@@ -75,7 +75,7 @@ When done, save and exit the *hosts* file using the `:wq` command of the editor.
75
75
76
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`:
@@ -85,7 +85,7 @@ Now that the required packages are installed on the VM, join the VM to the manag
85
85
86
86
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:
87
87
88
-
```console
88
+
```bash
89
89
sudo realm discover AADDSCONTOSO.COM
90
90
```
91
91
@@ -99,13 +99,13 @@ Now that the required packages are installed on the VM, join the VM to the manag
99
99
100
100
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]`:
@@ -123,21 +123,21 @@ By default, users can only sign in to a VM using SSH public key-based authentica
123
123
124
124
1. Open the *sshd_conf* file with an editor:
125
125
126
-
```console
126
+
```bash
127
127
sudo vi /etc/ssh/sshd_config
128
128
```
129
129
130
130
1. Update the line for*PasswordAuthentication* to *yes*:
131
131
132
-
```console
132
+
```bash
133
133
PasswordAuthentication yes
134
134
```
135
135
136
136
When done, save and exit the *sshd_conf* file using the `:wq`command of the editor.
137
137
138
138
1. To apply the changes and let users sign in using a password, restart the SSH service:
139
139
140
-
```console
140
+
```bash
141
141
sudo systemctl restart sshd
142
142
```
143
143
@@ -147,13 +147,13 @@ To grant members of the *AAD DC Administrators* group administrative privileges
147
147
148
148
1. Open the *sudoers* file for editing:
149
149
150
-
```console
150
+
```bash
151
151
sudo visudo
152
152
```
153
153
154
154
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*:
155
155
156
-
```console
156
+
```config
157
157
# Add 'AAD DC Administrators' group members as admins.
@@ -166,29 +166,29 @@ To verify that the VM has been successfully joined to the managed domain, start
166
166
167
167
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 *centos.aaddscontoso.com*. If you use the Azure Cloud Shell, use the public IP address of the VM rather than the internal DNS name.
@@ -188,15 +188,15 @@ To join the managed domain using **winbind** and the *`samba net` command*:
188
188
189
189
1. Install kerberos client and samba-winbind:
190
190
191
-
```console
191
+
```bash
192
192
sudo zypper in krb5-client samba-winbind
193
193
```
194
194
195
195
2. Edit the configuration files:
196
196
197
197
* /etc/samba/smb.conf
198
198
199
-
```ini
199
+
```config
200
200
[global]
201
201
workgroup = AADDSCONTOSO
202
202
usershare allow guests = NO #disallow guests from sharing
@@ -215,7 +215,7 @@ To join the managed domain using **winbind** and the *`samba net` command*:
215
215
216
216
* /etc/krb5.conf
217
217
218
-
```ini
218
+
```config
219
219
[libdefaults]
220
220
default_realm = AADDSCONTOSO.COM
221
221
clockskew = 300
@@ -239,7 +239,7 @@ To join the managed domain using **winbind** and the *`samba net` command*:
239
239
240
240
* /etc/security/pam_winbind.conf
241
241
242
-
```ini
242
+
```config
243
243
[global]
244
244
cached_login = yes
245
245
krb5_auth = yes
@@ -249,46 +249,46 @@ To join the managed domain using **winbind** and the *`samba net` command*:
249
249
250
250
* /etc/nsswitch.conf
251
251
252
-
```ini
252
+
```config
253
253
passwd: compat winbind
254
254
group: compat winbind
255
255
```
256
256
257
257
3. Check that the date and timein Azure AD and Linux are in sync. You can do this by adding the Azure AD server to the NTP service:
258
258
259
-
1. Add the following line to /etc/ntp.conf:
259
+
1. Add the following line to `/etc/ntp.conf`:
260
260
261
-
```console
261
+
```config
262
262
server aaddscontoso.com
263
263
```
264
264
265
265
1. Restart the NTP service:
266
266
267
-
```console
267
+
```bash
268
268
sudo systemctl restart ntpd
269
269
```
270
270
271
271
4. Join the domain:
272
272
273
-
```console
273
+
```bash
274
274
sudo net ads join -U Administrator%Mypassword
275
275
```
276
276
277
277
5. Enable winbind as a login sourcein the Linux Pluggable Authentication Modules (PAM):
278
278
279
-
```console
280
-
pam-config --add --winbind
279
+
```bash
280
+
config pam-config --add --winbind
281
281
```
282
282
283
283
6. Enable automatic creation of home directories so that users can log in:
284
284
285
-
```console
286
-
pam-config -a --mkhomedir
285
+
```bash
286
+
sudo pam-config -a --mkhomedir
287
287
```
288
288
289
289
7. Start and enable the winbind service:
290
290
291
-
```console
291
+
```bash
292
292
sudo systemctl enable winbind
293
293
sudo systemctl start winbind
294
294
```
@@ -299,21 +299,21 @@ By default, users can only sign in to a VM using SSH public key-based authentica
299
299
300
300
1. Open the *sshd_conf* file with an editor:
301
301
302
-
```console
302
+
```bash
303
303
sudo vi /etc/ssh/sshd_config
304
304
```
305
305
306
306
1. Update the line for*PasswordAuthentication* to *yes*:
307
307
308
-
```console
308
+
```config
309
309
PasswordAuthentication yes
310
310
```
311
311
312
312
When done, save and exit the *sshd_conf* file using the `:wq`command of the editor.
313
313
314
314
1. To apply the changes and let users sign in using a password, restart the SSH service:
315
315
316
-
```console
316
+
```bash
317
317
sudo systemctl restart sshd
318
318
```
319
319
@@ -323,13 +323,13 @@ To grant members of the *AAD DC Administrators* group administrative privileges
323
323
324
324
1. Open the *sudoers* file for editing:
325
325
326
-
```console
326
+
```bash
327
327
sudo visudo
328
328
```
329
329
330
330
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*:
331
331
332
-
```console
332
+
```config
333
333
# Add 'AAD DC Administrators' group members as admins.
@@ -342,29 +342,29 @@ To verify that the VM has been successfully joined to the managed domain, start
342
342
343
343
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 *linux-q2gr.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