| author | cherylmc |
|---|---|
| ms.service | azure-bastion |
| ms.topic | include |
| ms.date | 01/28/2025 |
| ms.author | cherylmc |
-
Add the following to your $HOME.ssh\config.
Host tunneltunnel HostName 127.0.0.1 Port 2222 User mylogin StrictHostKeyChecking=No UserKnownHostsFile=\\.\NUL -
Add the tunnel connection to your established tunnel connection.
az network bastion tunnel --name mybastion --resource-group myrg --target-resource-id /subscriptions/<mysubscription>/resourceGroups/myrg/providers/Microsoft.Compute/virtualMachines/myvm --resource-port 22 --port 22 -
Create an ssh tunnel in the bastion tunnel.
ssh -L 2222:127.0.0.1:22 [email protected] -
Use VS Code to connect to your tunnel connection.