Skip to content

Commit 3efbe73

Browse files
Merge pull request #232822 from msaenzbosupport/patch-9
[Doc-a-Thon|Updating code blocks
2 parents 87c75f1 + b7b8b69 commit 3efbe73

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

articles/active-directory-domain-services/join-suse-linux-vm.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Once the VM is deployed, follow the steps to connect to the VM using SSH.
5353

5454
To make sure that the VM host name is correctly configured for the managed domain, edit the */etc/hosts* file and set the hostname:
5555

56-
```console
56+
```bash
5757
sudo vi /etc/hosts
5858
```
5959

@@ -64,7 +64,7 @@ In the *hosts* file, update the *localhost* address. In the following example:
6464

6565
Update these names with your own values:
6666

67-
```console
67+
```config
6868
127.0.0.1 linux-q2gr linux-q2gr.aaddscontoso.com
6969
```
7070

@@ -178,7 +178,7 @@ To join the managed domain using **winbind** and the *YaST command line interfac
178178

179179
* Join the domain:
180180

181-
```console
181+
```bash
182182
sudo yast samba-client joindomain domain=aaddscontoso.com user=<admin> password=<admin password> machine=<(optional) machine account>
183183
```
184184

@@ -188,15 +188,15 @@ To join the managed domain using **winbind** and the *`samba net` command*:
188188

189189
1. Install kerberos client and samba-winbind:
190190

191-
```console
191+
```bash
192192
sudo zypper in krb5-client samba-winbind
193193
```
194194

195195
2. Edit the configuration files:
196196

197197
* /etc/samba/smb.conf
198198

199-
```ini
199+
```config
200200
[global]
201201
workgroup = AADDSCONTOSO
202202
usershare allow guests = NO #disallow guests from sharing
@@ -215,7 +215,7 @@ To join the managed domain using **winbind** and the *`samba net` command*:
215215

216216
* /etc/krb5.conf
217217

218-
```ini
218+
```config
219219
[libdefaults]
220220
default_realm = AADDSCONTOSO.COM
221221
clockskew = 300
@@ -239,7 +239,7 @@ To join the managed domain using **winbind** and the *`samba net` command*:
239239

240240
* /etc/security/pam_winbind.conf
241241

242-
```ini
242+
```config
243243
[global]
244244
cached_login = yes
245245
krb5_auth = yes
@@ -249,46 +249,46 @@ To join the managed domain using **winbind** and the *`samba net` command*:
249249

250250
* /etc/nsswitch.conf
251251

252-
```ini
252+
```config
253253
passwd: compat winbind
254254
group: compat winbind
255255
```
256256

257257
3. Check that the date and time in Azure AD and Linux are in sync. You can do this by adding the Azure AD server to the NTP service:
258258

259-
1. Add the following line to /etc/ntp.conf:
259+
1. Add the following line to `/etc/ntp.conf`:
260260

261-
```console
261+
```config
262262
server aaddscontoso.com
263263
```
264264

265265
1. Restart the NTP service:
266266

267-
```console
267+
```bash
268268
sudo systemctl restart ntpd
269269
```
270270

271271
4. Join the domain:
272272

273-
```console
273+
```bash
274274
sudo net ads join -U Administrator%Mypassword
275275
```
276276

277277
5. Enable winbind as a login source in the Linux Pluggable Authentication Modules (PAM):
278278

279-
```console
280-
pam-config --add --winbind
279+
```bash
280+
config pam-config --add --winbind
281281
```
282282

283283
6. Enable automatic creation of home directories so that users can log in:
284284

285-
```console
286-
pam-config -a --mkhomedir
285+
```bash
286+
sudo pam-config -a --mkhomedir
287287
```
288288

289289
7. Start and enable the winbind service:
290290

291-
```console
291+
```bash
292292
sudo systemctl enable winbind
293293
sudo systemctl start winbind
294294
```
@@ -299,21 +299,21 @@ By default, users can only sign in to a VM using SSH public key-based authentica
299299

300300
1. Open the *sshd_conf* file with an editor:
301301

302-
```console
302+
```bash
303303
sudo vi /etc/ssh/sshd_config
304304
```
305305

306306
1. Update the line for *PasswordAuthentication* to *yes*:
307307

308-
```console
308+
```config
309309
PasswordAuthentication yes
310310
```
311311

312312
When done, save and exit the *sshd_conf* file using the `:wq` command of the editor.
313313

314314
1. To apply the changes and let users sign in using a password, restart the SSH service:
315315

316-
```console
316+
```bash
317317
sudo systemctl restart sshd
318318
```
319319

@@ -323,13 +323,13 @@ To grant members of the *AAD DC Administrators* group administrative privileges
323323

324324
1. Open the *sudoers* file for editing:
325325

326-
```console
326+
```bash
327327
sudo visudo
328328
```
329329

330330
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*:
331331

332-
```console
332+
```config
333333
# Add 'AAD DC Administrators' group members as admins.
334334
%AAD\ DC\ [email protected] ALL=(ALL) NOPASSWD:ALL
335335
```
@@ -342,29 +342,29 @@ To verify that the VM has been successfully joined to the managed domain, start
342342

343343
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.
344344

345-
```console
346-
ssh -l [email protected] linux-q2gr.aaddscontoso.com
345+
```bash
346+
sudo ssh -l [email protected] linux-q2gr.aaddscontoso.com
347347
```
348348

349349
2. When you've successfully connected to the VM, verify that the home directory was initialized correctly:
350350
351-
```console
352-
pwd
351+
```bash
352+
sudo pwd
353353
```
354354
355355
You should be in the */home* directory with your own directory that matches the user account.
356356
357357
3. Now check that the group memberships are being resolved correctly:
358358
359-
```console
360-
id
359+
```bash
360+
sudo id
361361
```
362362
363363
You should see your group memberships from the managed domain.
364364
365365
4. If you signed in to the VM as a member of the *AAD DC Administrators* group, check that you can correctly use the `sudo` command:
366366
367-
```console
367+
```bash
368368
sudo zypper update
369369
```
370370

0 commit comments

Comments
 (0)