<p>I am trying to connect with SSH to a scale set-based AKS cluster node for maintenance purposes. I am following the instructions in this article:
<code>https://learn.microsoft.com/en-us/azure/aks/ssh</code></p>
<p>However, when I run:
<code>az vmss extension set --name VMAccessForLinux --protected-settings '{\&quot;username\&quot;:\&quot;azureuser\&quot;, \&quot;ssh_key\&quot;:\&quot;$(cat ~/.ssh/id_rsa.pub)\&quot;}' --publisher Microsoft.OSTCExtensions --resource-group $RG_NAME --version 1.4 --vmss-name $NODE_NAME</code></p>
<p>I get the following error:
<code>VM has reported a failure when processing extension 'VMAccessForLinux'. Error message: &quot;Enable failed: Failed to generate public key file.</code></p>
<p>My SSH key pair is located at <code>C:\Users\username\.ssh</code> and readable. I have tried generating multiple pairs, but the issue does not seem to be here. For generating the keys I used: <code>ssh-keygen -m PEM -t rsa -b 4096</code></p>
<p>Any idea where I can find more information about this error or how can I troubleshoot it in more detail? Thank you.</p>

Poctan
<p>The reason is that you need to use the double quotes to set the value of the parameter `--protected-setting like this:</p>
<pre><code>--protected-settings &quot;{\&quot;username\&quot;:\&quot;azureuser\&quot;, \&quot;ssh_key\&quot;:\&quot;$(cat ~/.ssh/id_rsa.pub)\&quot;}&quot;
</code></pre>
<p>Only when you use the double quotes then the character <code>\</code> can work. You need to read the document carefully. And make sure the SSH public key is in the right format.</p>
