Describe the bug
When trying to connect to a Linux VM in Azure from a AAD-joined Windows Server 2022, I'm facing a "UNPROTECTED PRIVATE KEY FILE" error.
I have followed the following documentation for this setup : https://learn.microsoft.com/en-us/azure/active-directory/devices/howto-vm-sign-in-azure-ad-linux
I've tried to change the permission of the parent folder (C:\Users\user\AppData\Local\Temp) but the problem persists.
Related command
az ssh vm --ip 192.168.1.5
Errors
C:\Users\user>az ssh vm --ip 192.168.1.5
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'C:\Users\user\AppData\Local\Temp\2\aadsshcertxhknyen8\id_rsa.pub-aadcert.pub' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "C:\Users\user\AppData\Local\Temp\2\aadsshcertxhknyen8\id_rsa.pub-aadcert.pub": bad permissions
[email protected]@192.168.1.5: Permission denied (publickey).
C:\Users\user>
Issue script & Debug output
C:\Users\user>az ssh vm --ip 192.168.1.5 --debug
cli.knack.cli: Command arguments: ['ssh', 'vm', '--ip', '192.168.1.5', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
Enable VT mode.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x017AB4A8>, <function OutputProducer.on_global_arguments at 0x018AB6E8>, <function CLIQuery.on_global_arguments at 0x019C8340>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'ssh': ['azext_ssh']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: ssh 0.482 1 4 C:\Users\user.azure\cliextensions\ssh
cli.azure.cli.core: Total (1) 0.482 1 4
cli.azure.cli.core: Loaded 1 groups, 4 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : ssh vm
cli.azure.cli.core: Command table: ssh vm
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x03B6B4F0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\user.azure\commands\2023-08-08.15-50-26.ssh_vm.3816.log'.
az_command_data_logger: command args: ssh vm --ip {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x03B93610>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x03BA4580>, <function register_cache_arguments..add_cache_arguments at 0x03BA4778>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x018AB730>, <function CLIQuery.handle_query_parameter at 0x019C8388>, <function register_ids_argument..parse_ids_arguments at 0x03BA4730>]
az_command_data_logger: extension name: ssh
az_command_data_logger: extension version: 2.0.1
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ComputeManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='C:\Users\user\.azure\msal_token_cache.bin', encrypt=True
cli.azure.cli.core.auth.binary_cache: load: C:\Users\user.azure\msal_http_cache.bin
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com//discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com//v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com//kerberos', 'tenant_region_scope': 'EU', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msal.application: Broker enabled? True
cli.azext_ssh.ssh_utils: Platform architecture: 32bit
cli.azext_ssh.ssh_utils: OS architecture: 64bit
cli.azext_ssh.ssh_utils: System Root: C:\Windows
cli.azext_ssh.ssh_utils: Attempting to run ssh-keygen from path C:\Windows\SysNative\openSSH\ssh-keygen.exe
cli.azext_ssh.ssh_utils: Running ssh-keygen command C:\Windows\SysNative\openSSH\ssh-keygen.exe -f C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa -t rsa -q -N
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com//discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com//v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com//kerberos', 'tenant_region_scope': 'EU', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msal.application: Broker enabled? True
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://pas.windows.net/CheckMyAccess/Linux/.default',), kwargs={'data': {'token_type': 'ssh-cert', 'req_cnf': '{"kty": "RSA", "n": "", "e": "AQAB", "kid": ""}', 'key_id': ''}}
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://pas.windows.net/CheckMyAccess/Linux/.default',), claims=None, kwargs={'data': {'token_type': 'ssh-cert', 'req_cnf': '{"kty": "RSA", "n": "", "e": "AQAB", "kid": ""}', 'key_id': ''}}
msal.broker: [MSAL:0001] INFO LogTelemetryData:332 Printing Telemetry for Correlation ID: b3819a8b-0a63-4a7b-a567-bb8d2acf234b
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: start_time, Value: 2023-08-08T15:50:29.000Z
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: api_name, Value: ReadAccountById
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: was_request_throttled, Value: false
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: request_duration, Value: 0
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: authority_type, Value: Unknown
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: msal_version, Value: 1.1.0+local
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: correlation_id, Value: b3819a8b-0a63-4a7b-a567-bb8d2acf234b
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: stop_time, Value: 2023-08-08T15:50:29.000Z
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: msalruntime_version, Value: 0.13.9
msal.broker: [MSAL:0001] INFO LogTelemetryData:340 Key: is_successful, Value: true
msal.broker: [MSAL:0002] INFO SetCorrelationId:220 Set correlation ID: b3819a8b-0a63-4a7b-a567-bb8d2acf234b
msal.broker: [MSAL:0002] INFO EnqueueBackgroundRequest:677 The original authority is 'https://login.microsoftonline.com/'
msal.broker: [MSAL:0002] INFO ModifyAndValidateAuthParameters:182 Additional query parameter added successfully. Key: '(pii)' Value: '(pii)'
msal.broker: [MSAL:0002] INFO ModifyAndValidateAuthParameters:182 Additional query parameter added successfully. Key: '(pii)' Value: '(pii)'
msal.broker: [MSAL:0002] INFO ModifyAndValidateAuthParameters:182 Additional query parameter added successfully. Key: '(pii)' Value: '(pii)'
msal.broker: [MSAL:0002] INFO ModifyAndValidateAuthParameters:199 Authority Realm: *************************
msal.broker: [MSAL:0003] INFO LogTelemetryData:332 Printing Telemetry for Correlation ID: b3819a8b-0a63-4a7b-a567-bb8d2acf234b
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: start_time, Value: 2023-08-08T15:50:29.000Z
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: api_name, Value: AcquireTokenSilently
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: was_request_throttled, Value: false
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: request_duration, Value: 40
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: authority_type, Value: AAD
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: access_token_expiry_time, Value: 2023-08-08T16:21:26.000Z
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: read_token, Value: ID|AT
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: msal_version, Value: 1.1.0+local
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: client_id, Value: *************************
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: correlation_id, Value: b3819a8b-0a63-4a7b-a567-bb8d2acf234b
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: stop_time, Value: 2023-08-08T15:50:29.000Z
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: msalruntime_version, Value: 0.13.9
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: original_authority, Value: https://login.microsoftonline.com/
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: request_eligible_for_broker, Value: true
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: broker_app_used, Value: false
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: additional_query_parameters_count, Value: 3
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: auth_flow, Value: AT
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: is_successful, Value: true
msal.broker: [MSAL:0003] INFO LogTelemetryData:340 Key: authorization_type, Value: WindowsIntegratedAuth
msal.broker: [MSAL:0003] INFO LogTelemetryData:345 Printing Execution Flow:
msal.broker: [MSAL:0003] INFO LogTelemetryData:353 {"t":"8b2yn","tid":3,"ts":0,"l":2},{"t":"8dqkx","tid":3,"ts":0,"l":2},{"t":"8dqik","tid":3,"ts":0,"l":2},{"t":"8b2ht","tid":3,"ts":0,"l":2},{"t":"7e60d","tid":3,"ts":0,"l":2,"a":2,"ie":0},{"t":"7e60e","tid":3,"ts":0,"l":2,"a":2,"ie":1},{"t":"8dqin","tid":3,"ts":0,"l":2},{"t":"7e60f","tid":3,"ts":0,"l":2,"a":2,"ie":0},{"t":"7e60g","tid":3,"ts":11,"l":2,"a":2,"ie":1},{"t":"7e60h","tid":3,"ts":11,"l":2,"a":2,"ie":0},{"t":"7e60i","tid":3,"ts":12,"l":2,"a":2,"ie":1},{"t":"8dqit","tid":3,"ts":12,"l":2},{"t":"6xuag","tid":3,"ts":12,"l":2}
msal.token_cache: event={
"_account_id": "",
"client_id": "",
"data": {
"key_id": "",
"req_cnf": "{"kty": "RSA", "n": "", "e": "AQAB", "kid": ""}",
"token_type": "ssh-cert"
},
"response": {
"_account_id": "",
"_msalruntime_telemetry": {
"access_token_expiry_time": "2023-08-08T16:21:26.000Z",
"additional_query_parameters_count": "3",
"api_name": "AcquireTokenSilently",
"auth_flow": "AT",
"authority_type": "AAD",
"authorization_type": "WindowsIntegratedAuth",
"broker_app_used": "false",
"client_id": "",
"correlation_id": "b3819a8b-0a63-4a7b-a567-bb8d2acf234b",
"is_successful": "true",
"msal_version": "1.1.0+local",
"msalruntime_version": "0.13.9",
"original_authority": "https://login.microsoftonline.com/",
"read_token": "ID|AT",
"request_duration": "40",
"request_eligible_for_broker": "true",
"start_time": "2023-08-08T15:50:29.000Z",
"stop_time": "2023-08-08T15:50:29.000Z",
"was_request_throttled": "false"
},
"access_token": "",
"client_info": "",
"expires_in": 1857,
"id_token": "",
"id_token_claims": "***",
"scope": "https://pas.windows.net/CheckMyAccess/Linux/user_impersonation https://pas.windows.net/CheckMyAccess/Linux/.default",
"token_type": "ssh-cert"
},
"scope": [
"https://pas.windows.net/CheckMyAccess/Linux/user_impersonation",
"https://pas.windows.net/CheckMyAccess/Linux/.default"
],
"token_endpoint": "https://login.microsoftonline.com//oauth2/v2.0/token"
}
cli.azext_ssh.custom: Generating certificate C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub
cli.azext_ssh.ssh_utils: Platform architecture: 32bit
cli.azext_ssh.ssh_utils: OS architecture: 64bit
cli.azext_ssh.ssh_utils: System Root: C:\Windows
cli.azext_ssh.ssh_utils: Attempting to run ssh-keygen from path C:\Windows\SysNative\openSSH\ssh-keygen.exe
cli.azext_ssh.ssh_utils: Running ssh-keygen command C:\Windows\SysNative\openSSH\ssh-keygen.exe -L -f C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub
cli.azext_ssh.ssh_utils: Platform architecture: 32bit
cli.azext_ssh.ssh_utils: OS architecture: 64bit
cli.azext_ssh.ssh_utils: System Root: C:\Windows
cli.azext_ssh.ssh_utils: Attempting to run ssh from path C:\Windows\SysNative\openSSH\ssh.exe
cli.azext_ssh.ssh_utils: Running ssh command C:\Windows\SysNative\openSSH\ssh.exe 192.168.1.5 -l [email protected] -i C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa -o CertificateFile="C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub" -vvv
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug3: Failed to open file:C:/Users/user/.ssh/config error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolve_canonicalize: hostname 192.168.1.5 is address
debug2: ssh_connect_direct
debug1: Connecting to 192.168.1.5 [192.168.1.5] port 22.
debug1: Connection established.
debug1: identity file C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa type 0
debug1: certificate file C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub type 4
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.3
debug1: match: OpenSSH_8.9p1 Ubuntu-3ubuntu0.3 pat OpenSSH compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.1.5:22 as '[email protected]'
debug3: hostkeys_foreach: reading file "C:\Users\user/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file C:\Users\user/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from 192.168.1.5
debug3: Failed to open file:C:/Users/user/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,[email protected],diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: compression: none
debug1: kex: client->server cipher: [email protected] MAC: compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:*
debug3: hostkeys_foreach: reading file "C:\Users\user/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file C:\Users\user/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from 192.168.1.5
debug3: Failed to open file:C:/Users/user/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug1: Host '192.168.1.5' is known and matches the ECDSA host key.
debug1: Found key in C:\Users\user/.ssh/known_hosts:1
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug3: unable to connect to pipe \\.\pipe\openssh-ssh-agent, error: 2
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub RSA-CERT SHA256:************************* explicit
debug1: Will attempt key: C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa RSA SHA256:************************* explicit
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: kex_input_ext_info: [email protected] (unrecognised)
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub RSA-CERT SHA256:************************* explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub RSA-CERT SHA256:************************* explicit
debug3: sign_and_send_pubkey: RSA-CERT SHA256:*************************
debug1: sign_and_send_pubkey: no separate private key for certificate "C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub"
debug3: sign_and_send_pubkey: signing using [email protected]
debug3: Bad permissions. Try removing permissions for user: XXXXXXXXXXXX\None (S-1-5-21-1488898208-1225971280-3526109899-513) on file C:/Users/user/AppData/Local/Temp/2/aadsshcertt5ck7_gk/id_rsa.pub-aadcert.pub.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa.pub-aadcert.pub": bad permissions
debug1: Offering public key: C:\Users\user\AppData\Local\Temp\2\aadsshcertt5ck7_gk\id_rsa RSA SHA256:************************* explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
[email protected]@192.168.1.5: Permission denied (publickey).
[36mcli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x03B90CD0>, <function _x509_from_base64_to_hex_transform at 0x03B90D18>][0m
[0m
ute [][0m
C:\Users\user>
Expected behavior
The SSH connection to the Linux VM should directly open.
Environment Summary
C:\Users\user>az --version
azure-cli 2.51.0
core 2.51.0
telemetry 1.1.0
Extensions:
ssh 2.0.1
Dependencies:
msal 1.24.0b1
azure-mgmt-resource 23.1.0b2
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\user.azure\cliextensions'
Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
C:\Users\user>
Additional context
No response