Skip to content

az ssh vm is omitting ssh.exe output #21038

@mvaferreira

Description

@mvaferreira

Client-side issue using 'az ssh vm' to connect to Linux using Azure AD user.

If you're trying to connect to ssh using Azure AD credentials (following https://docs.microsoft.com/en-us/azure/active-directory/devices/howto-vm-sign-in-azure-ad-linux#login-using-azure-ad-user-account-to-ssh-into-the-linux-vm) through 'az ssh vm' cli command, you had it working before, then deleted the VM, created another VM with the same name (hostname), then 'az ssh vm' command will omit the output of C:\Windows\System32\OpenSSH\ssh.exe (haven't tested on Linux).

It should display "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" output, but instead, it just returns without any output.

This happens since VM was recreated, another SSH fingerprint is presented. SSH client will refuse connecting to the server.

To confirm this is the issue, try connecting using:

C:\Windows\System32\OpenSSH\ssh.exe userPrincipalName@ip <-- this will display the above message.

The following will display no output:

az ssh vm -n <vmname> -g <resourcegroupname>
az ssh vm --ip <private_or_public_ip>

Workaround is to fix or delete 'known_hosts' file at:

%userprofile%\.ssh\known_hosts


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SSHService AttentionThis issue is responsible by Azure service team.VM SSHcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions