Skip to content

"az ssh config" Fails with a SP #10083

Description

@jam-re

Describe the bug

I'm unable to use the generated ssh config from "az ssh config" to SCP to a Linux VM using a SP. Is it supposed to be working ?

The VM has the AADSSHLoginForLinux extension enabled.
The SP has Virtual Machine User Login on the VM and using az ssh vm I'm able to open a ssh connection.

Related command

az login --service-principal -u <SP_CLIENT_ID> -p <SP_PASSWORD> --tenant <TENANT_ID>
az ssh config --yes --overwrite -n <VM NAME> -g <VM_RG> --file ~/.ssh/config
echo abc > test.txt
scp -F ~/.ssh/config test.txt <VM_IP>:/tmp

SSHD logs:

Jul 07 06:10:06 <VM NAME> sshd[1613659]: Invalid user <SP_CLIENT_ID>  from X.Y.Z port 47070
Jul 07 06:10:06 <VM NAME> sshd[1613659]: Connection closed by invalid user <SP_CLIENT_ID> X.Y.Z port 47070 [preauth]

Note that using the following works:

(same az login command as above)
az ssh vm -n <VM NAME> -g <VM_RG>

Errors

No error

Issue script & Debug output

No stack trace

Expected behavior

The scp command should work

Environment Summary

az --version
azure-cli 2.87.0 *

core 2.87.0 *
telemetry 1.1.0

Extensions:
ssh 2.0.9

Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    AccountAuto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.VM SSHbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions