Reputation: 606
I've created Linux VM on Azure. Locally I'm using windows. I set public key generated with PuTTy.
I've followed How to use SSH keys with Windows on Azure
I'm able to log in to VM using PuTTy by specifying "private key file for authentication", this works. However I don't know how I suppose to log in to the machine with Azure Cloud shell. I see there is -i
option in ssh
but the key file is on my local machine.
If i simply type ssh username@ip
(as tutorial is saying) I got "Permission denied (public key)." response.
How should I do it? Can I upload the key file to azure?
Upvotes: 4
Views: 3350
Reputation: 31424
Connect to Azure VM(Linux) from Azure Cloud Shell using ssh public key, you can follow the steps below.
ssh-keygen -t rsa
, you can Entry all time.~/.ssh/
, there are the files like this:
~/.ssh/
. If this directory has the file authorized_keys
, you can change the content with id_rsa.pub.ssh -p port username@publicIp
.Upvotes: 3