Skip to main content
Version: Next

Task 04 — SSH Connectivity to Nodes

DOCUMENT CATEGORY: Implementation Guide SCOPE: Azure Local Cluster Nodes — Post-Deployment PURPOSE: Deploy the Open SSH for Windows Arc VM extension on each cluster node and configure Azure Arc SSH tunneled access (HybridConnectivity) so operators can reach nodes securely without opening inbound firewall ports or requiring direct network adjacency.


Overview

Azure Arc SSH routes connections through the HybridConnectivity relay — no public IP, no open inbound port 22 on upstream firewalls. The flow is:

Operator workstation → Azure Relay (HybridConnectivity) → Arc agent → WindowsOpenSSH (sshd)

This task installs OpenSSH using the first-party WindowsOpenSSH Arc VM extension (publisher: Microsoft.Azure.OpenSSH, type: WindowsOpenSSH) — avoiding any WinRM/PSRemoting dependency — and configures the HybridConnectivity endpoint on each Arc-enrolled node.

Arc enrollment is a prerequisite

Each node must already be Arc-enrolled (completed in Phase 01 — Arc Registration). Arc agent version ≥ 1.31 is required. Check with azcmagent version on each node.


Extension Reference

FieldValue
Display NameOpen SSH for Windows
PublisherMicrosoft.Azure.OpenSSH
TypeWindowsOpenSSH
Extension NameWindowsOpenSSH
InstallsOpenSSH Server (sshd), sets service to Automatic, creates Windows Firewall rule

Prerequisites

RequirementDetails
Azure permissionsContributor or Owner on the subscription (register RP + create endpoints)
Arc extension deploymicrosoft.hybridcompute/machines/extensions/write on each Arc machine resource
Azure CLI (scripts)az CLI logged in (az account show); az extension add --name ssh
YAML key (orchestrated)compute.nodes.<key>.arc_resource_id populated per node
RBAC for ongoing SSH access

After this task, operators connecting via az ssh arc need the Virtual Machine Local User Login role on each Arc machine resource. RBAC assignments are out of scope for this task — assign at resource group level to avoid hitting the per-subscription role assignment limit.


Variables from variables.yml

PathTypeDescription
compute.nodes.<key>.arc_resource_idstringArc machine resource ID per node
compute.azure_local.arc_resource_groupstringResource group
azure_platform.subscriptions.lab.idstringSubscription ID

Execution Options

When to use:

  • Ad-hoc installs or verifying extension state on individual nodes
  • No scripting environment available
  • Post-deployment check or re-install of a specific node

Step 1 — Install the WindowsOpenSSH extension (per node)

Repeat for each cluster node.

  1. Open the Azure portal and navigate to Azure ArcMachines
  2. Select the Arc machine for the first node (e.g. azl-demo-01-n01)
  3. In the left menu under Settings, select Extensions
  4. Click + Add
  5. Find and select Open SSH for Windows (publisher: Microsoft.Azure.OpenSSH)
  6. Click Next → accept defaults → Review + createCreate
  7. Wait for the extension to show Succeeded in the Extensions list
  8. Repeat steps 2–7 for every cluster node
Verify installation

After install, confirm the extension state in the portal Extensions blade shows ProvisioningState: Succeeded. You can also query via CLI:

Verify extension state
az connectedmachine extension show `
--resource-group "rg-c01-azl-eus-01" `
--machine-name "azl-demo-01-n01" `
--name "WindowsOpenSSH"

Step 2 — Configure HybridConnectivity (once per subscription + per node)

2a — Register the resource provider (one-time per subscription):

Register HybridConnectivity RP and enable SSH per node
# Register RP (one-time per subscription)
az provider register -n Microsoft.HybridConnectivity
az extension add --name ssh

# Poll until registered
do {
Start-Sleep 15
$state = az provider show -n Microsoft.HybridConnectivity --query registrationState -o tsv
Write-Host "RP state: $state"
} until ($state -eq 'Registered')

# Run the following block once per node — change $machine each time
$sub = "5e04c7f2-0298-439a-ab56-6d81d6bdc796"
$rg = "rg-c01-azl-eus-01"
$machine = "azl-demo-01-n01" # <-- change per node

# Create default connectivity endpoint
az rest `
--method put `
--uri "https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.HybridCompute/machines/$machine/providers/Microsoft.HybridConnectivity/endpoints/default?api-version=2023-03-15" `
--body '{\"properties\":{\"type\":\"default\"}}'

# Configure SSH service on the endpoint
az rest `
--method put `
--uri "https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.HybridCompute/machines/$machine/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/SSH?api-version=2023-03-15" `
--body '{\"properties\":{\"serviceName\":\"SSH\",\"port\":22}}'

Connecting:

Connect via Arc SSH
az ssh arc `
--resource-group "rg-c01-azl-eus-01" `
--name "azl-demo-01-n01" `
--local-user "DOMAIN\username"

Validation

1 — Verify extension state on all nodes

Check WindowsOpenSSH extension provisioning state
$sub = "5e04c7f2-0298-439a-ab56-6d81d6bdc796"
$rg = "rg-c01-azl-eus-01"

foreach ($machine in @("azl-demo-01-n01", "azl-demo-01-n02")) {
$state = az connectedmachine extension show `
--resource-group $rg `
--machine-name $machine `
--name "WindowsOpenSSH" `
--query "provisioningState" `
-o tsv
Write-Host "$machine WindowsOpenSSH = $state" -ForegroundColor $(if ($state -eq 'Succeeded') {'Green'} else {'Red'})
}

2 — Verify HybridConnectivity SSH endpoint

Query SSH service configuration per node
$sub = "5e04c7f2-0298-439a-ab56-6d81d6bdc796"
$rg = "rg-c01-azl-eus-01"

foreach ($machine in @("azl-demo-01-n01", "azl-demo-01-n02")) {
$uri = "https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.HybridCompute/machines/$machine/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/SSH?api-version=2023-03-15"
Write-Host "`nNode: $machine"
az rest --method get --uri $uri | ConvertFrom-Json | Select-Object -ExpandProperty properties
}

Expected output per node:

{
"serviceName": "SSH",
"port": 22,
"resourceProvisioningState": "Succeeded"
}

3 — Test an Arc SSH connection

End-to-end connection test
az ssh arc `
--resource-group "rg-c01-azl-eus-01" `
--name "azl-demo-01-n01" `
--local-user "DOMAIN\username" `
--command "hostname"

Validation Summary

CheckCommandExpected
Extension installedaz connectedmachine extension show ... --query provisioningStateSucceeded
HybridConnectivity RPaz provider show -n Microsoft.HybridConnectivity --query registrationState -o tsvRegistered
SSH endpointaz rest --method get --uri .../serviceconfigurations/SSHresourceProvisioningState: Succeeded
Arc SSH connectaz ssh arc ... --command hostnameReturns node hostname

RBAC — Operator Access

The WindowsOpenSSH extension and HybridConnectivity endpoint control infrastructure. Each operator who needs to CONNECT via Arc SSH also needs the Virtual Machine Local User Login role on the Arc machine resources (or the containing resource group):

Assign Virtual Machine Local User Login to an operator or group
$sub = "5e04c7f2-0298-439a-ab56-6d81d6bdc796"
$rg = "rg-c01-azl-eus-01"
$objectId = "<operator-or-group-entra-object-id>"

az role assignment create `
--role "Virtual Machine Local User Login" `
--assignee $objectId `
--scope "/subscriptions/$sub/resourceGroups/$rg"
Windows nodes use local credentials for authentication

Microsoft Entra ID SSH login (AADSSHLoginForLinux) is Linux-only. On Windows nodes, sshd authenticates with Windows credentials (local or domain accounts). The Virtual Machine Local User Login RBAC role only controls who can open the HybridConnectivity tunnel — not who can authenticate to sshd itself.


Troubleshooting

IssueCauseResolution
SSH connection refused on port 22sshd service not running or Windows Firewall blockingStart service: Start-Service sshd; Set-Service sshd -StartupType Automatic; verify firewall: Get-NetFirewallRule -Name *ssh*
Arc SSH tunnel fails with RBAC errorUser lacks Virtual Machine Local User Login roleAssign the role: az role assignment create --role "Virtual Machine Local User Login" --assignee <objectId> --scope <resourceScope>
Authentication fails with valid credentialssshd_config not configured for password or key authEdit C:\ProgramData\ssh\sshd_config to enable PasswordAuthentication yes or configure authorized keys; restart: Restart-Service sshd

PreviousUpNext
Task 3: Security GroupsPhase 06 IndexTask 5: Storage Configuration