Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 802 Bytes

File metadata and controls

32 lines (25 loc) · 802 Bytes
author cherylmc
ms.service azure-bastion
ms.topic include
ms.date 01/28/2025
ms.author cherylmc
  1. Add the following to your $HOME.ssh\config.

    Host tunneltunnel
      HostName 127.0.0.1
      Port 2222
      User mylogin
      StrictHostKeyChecking=No
      UserKnownHostsFile=\\.\NUL
    
  2. 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
    
  3. Create an ssh tunnel in the bastion tunnel.

    ssh -L 2222:127.0.0.1:22 [email protected]
    
  4. Use VS Code to connect to your tunnel connection.