Hello @Joel Yang ,
I understand that you were unable to access Bastion even after setting up the ports correctly. You were able to SSH to your Azure VM directly but were not able to access the VM via Bastion.
You were getting the following error when trying to SSH to the Azure VM via Bastion: "the network connection to the bastion host appears unstable".
You didn't have any NSG associated to the Bastion subnet. You set the roles for IAM on the VM, Bastion, NIC correctly and also the NSG associated to the VM had ports 22,3389 allowed to both the public and private IP of the Bastion. You were using a Linux-based VM (not domain joined) that had a public IP but still were unable to SSH into it via Bastion.
We enabled a one-time free technical support for your subscription, and you created a support request for this issue.
The support team asked to reset the credentials of the VM and then Bastion to it, but you were still unable to access the VM.
Then the support team provided the below work arounds:
Option 1: To enable password authentication.
- SSH in as root to edit the sshd_config file. Change the line PasswordAuthentication no to PasswordAuthentication yes. After making that change, restart the SSH service.
https://learn.microsoft.com/en-us/azure/virtual-machines/linux-vm-connect?tabs=Linux
https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/reset-password
Option 2: Deploy new Linux VM with different image.
- We recommend you deploy a new Linux VM with the different image (not as existing VM's image) and Bastion to it.
You confirmed that the issue is now resolved.
Kindly let us know if the above helps or you need further assistance on this issue.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.