Azure CLI install ssh extension

Problem:

To enable AD authentication on a Linux OS Azure VM, you must install Azure CLI and have the SSH extension. However, the SSH extension is not installed automatically after installing Azure CLI.

I can guide you through the simple steps to add this extension.

Solution:

Ensure that the extension is not present:

~ az version
{
  "azure-cli": "2.49.0",
  "azure-cli-core": "2.49.0",
  "azure-cli-telemetry": "1.0.8",
  "extensions": {}
}

List available extensions:

~ az extension list-available --output table

Name    Version    Summary  Preview  Experimental  Installed
------- --------   -------  -------  ------------  --------------------------
...
ssh     1.1.6      SSH...   False    False         False
...

Add extension:

~ az extension add --name ssh

Ensure that the extension has been added:

~ az version
{
  "azure-cli": "2.49.0",
  "azure-cli-core": "2.49.0",
  "azure-cli-telemetry": "1.0.8",
  "extensions": {
    "ssh": "1.1.6"
  }
}

Change boot mode in Linux

There are 6 boot modes.

0 –  Halt (Shutdown)
1 – Single user mode
2 – Not yet implemented
3 – Full multi-user command line mode
4 – Not used.
5 – Full multi-user Graphical User Interface mode
6 – Reboot

Default mode is written into /etc/inittab file.

By changing the following line in that file,  the default boot mode will be changed:

id:5:initdefault:

If it is production server and you don’t need to use GUI interface you can set default boot mode to 3. This is beneficial, because  the mode 3 takes less memory(RAM)  than the mode 5.

id:3:initdefault:

Note: Be careful while changing the default mode, because the following values like 0(shutdown) or 6(reboot) will cause problems. Never try to set these values, I mean 0 or 6.