When I setup my Linux VM, I choose username rather than public key ssh key, as I had problems moving the ssh keys betwen clients. Anyways long story, I login using
ssh -l username remotehost from my MacBook every time I login, and never bother to setup the public keys to login without a password.
The solution was surprisingly easy.
From my MacBook, You need to run the following:
This Generates the public/private rsa key pair and saves the private key to /Users/username/.ssh/id_rsa) and the public key to
Once configured, you can copy the public key to the linux vm like this:
of course replacing the username and remote host with your Azure Linux vm login and the Azure Linux vm public url or ipaddress.
You can get this from here: