Using 'az ssh config' generated key and cert results in 'error: AuthorizedKeysCommand /usr/sbin/aad_certhandler' #6898
Labels
Auto-Assign
Auto assign by bot
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
This issue is responsible by Azure service team.
VM SSH
Describe the bug
I'm using 'az ssh config' command to generate ssh config file with private key and cert.
This method works for some servers, but not for others. All are azure provided ubuntu 22.04.3 LTS, including client.
'az ssh vm' command works without issues, hence this is not related to #4026 although looks similar. I'm trying to use ssh -F / scp -F command to use the ssh-config to log in.
Following workarounds already applied:
in client side ssh_config:
PubkeyAcceptedKeyTypes [email protected]
in server side (only applied in server side: with or without this it doesn't work):
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
Below are ssh client and server logs (redacted) for both scenarios.
Issue server
client side:
server side:
Working server
client side:
server side:
Related command
az ssh config --file "$ssh_config_file" --subscription $subscription -g $resource_group -n "$vm_name" --prefer-private-ip
Errors
client side:
debug1: send_pubkey_test: no mutual signature algorithm
server side:
Oct 25 09:43:50 AD-TEST aad_certhandler[30421]: The public key is of type ssh-rsa, not a certificate.
Oct 25 09:43:50 AD-TEST sshd[30419]: error: AuthorizedKeysCommand /usr/sbin/aad_certhandler [email protected] AAAAxxxxxxxxxxxxxxxxxxxxxxxxx
Issue script & Debug output
can be provided if the issue seems reasonable to investigate
Expected behavior
ssh / scp via ssh key / certificate should be successful in to vms with AAD extension enabled
Environment Summary
azure-cli 2.53.0 *
core 2.53.0 *
telemetry 1.1.0
Extensions:
ssh 2.0.2
Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2
Python location '/opt/az/bin/python3'
Extensions directory '/home/malshan/.azure/cliextensions'
Python (Linux) 3.10.10 (main, Sep 20 2023, 06:07:38) [GCC 11.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Additional context
servers and client: ubuntu LTS 22.04.3
The text was updated successfully, but these errors were encountered: