I have a new Ubuntu 18 server in Azure. I am using PowerShell (with the 2018 SSH client already installed). I have tried Putty also. Both with PowerShell and Putty I typed in ssh username@ipaddress, type yes to accept and then I get Permission denied (publickey).
My Azure settings: no password required to log in, just Pub/Priv keys. I let Azure create the Keys so that must be done and stored correctly.
I think the issue is that I am not associating the private key, which is stored on my Windows 10 machine, properly. To be honest, I never tried to associate it. I don't know how to. Am I supposed to be in the directory where the key is when using PowerShell? I was never prompted for the private key anywhere.
Best Answer
When you creating new VM with generate key pair option, it should be downloaded on your drive (by default on Download folder). Then you need to insert privatekey.pem when connecting over ssh by adding -i attribute :
But if you forgot or lost your keypair from azure. you can create new one using puttygen. Complete guide you can see in https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/create-with-putty/
4. it will create new user or updating the existing one 5. Double-click previously saved private key from puttygen, it will run as background service 6. Now you can ssh without adding -i attribute