admin管理员组

文章数量:1122832

I have a UAT Bastion-enabled Management VM in Azure.

I have already copied my public ssh-key into the machine.

I am able to access the machine using web-browser. However, I wish to connect via terminal due to familiary and ease-of-use.

I wish to connect to the VM from local terminal using the below command -

az network bastion ssh --name MyBastionHost --resource-group MyResourceGroup \
--target-resource-id vmResourceId --auth-type ssh-key \
--username xyz --ssh-key ~/.ssh/id_rsa

This gives me a 'bastion' is misspelled or not recognized by the system. error on local.

az cli version details -

  "azure-cli": "2.67.0",
  "azure-cli-core": "2.67.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {}
}

Local machine OS - MacOS

Remote VM - Ubuntu 22.04

Is bastion support disabled for this tenant ? Do I need to check any logs to find out ?

I have a UAT Bastion-enabled Management VM in Azure.

I have already copied my public ssh-key into the machine.

I am able to access the machine using web-browser. However, I wish to connect via terminal due to familiary and ease-of-use.

I wish to connect to the VM from local terminal using the below command -

az network bastion ssh --name MyBastionHost --resource-group MyResourceGroup \
--target-resource-id vmResourceId --auth-type ssh-key \
--username xyz --ssh-key ~/.ssh/id_rsa

This gives me a 'bastion' is misspelled or not recognized by the system. error on local.

az cli version details -

  "azure-cli": "2.67.0",
  "azure-cli-core": "2.67.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {}
}

Local machine OS - MacOS

Remote VM - Ubuntu 22.04

Is bastion support disabled for this tenant ? Do I need to check any logs to find out ?

Share Improve this question asked Nov 21, 2024 at 12:20 ForeverLearnerForeverLearner 2,0952 gold badges33 silver badges53 bronze badges 2
  • In order to connect to a Linux VM using the az network bastion ssh cmdlet, you may need to follow the prerequisites specified in the MS DOC. – Venkat V Commented Nov 22, 2024 at 4:13
  • The error message bastion' is misspelled or not recognized by the system is occurring because the Bastion extension is not installed on your laptop. To resolve this, run the command az extension update --name bastion to install the Bastion service – Venkat V Commented Nov 22, 2024 at 7:00
Add a comment  | 

1 Answer 1

Reset to default 0

This gives me a 'bastion' is misspelled or not recognized by the system. error on local.

The error you are encountering is due to the Bastion extension not being installed on your laptop

To resolve this, run the command below to install the Bastion service

az extension update --name bastion

Once the extension is installed, make sure to verify the Bastion installation.

az extension show --name bastion

Below are the prerequisites to run the az network bastion ssh.Follow the MS Doc for more details

Bastion supports the Standard and Premium tiers, along with Native client support option enabled. For more details, refer to the MS DOC.

After configuring all the settings, I am able to connect to the Linux VM using az network bastion ssh

本文标签: ssh into Azure VM from local MacOS terminal using Bastion tunnelStack Overflow