使用Putty採用SSH private key連線到Azure Linux Virtual Machine
1.下載private key
如果使用Azure Cloud Shell(Bash)建立的Linux VM
az vm create --resource-group myRG1 --name myVM2 --image UbuntuLTS --admin-username azureuser --generate-ssh-keys
SSH public-private key會儲存在~/.ssh/目錄下
~/.ssh/id_rsa是private key
~/.ssh/id_rsa.pub是public key
2.下載id_rsa (private key)
輸入/id_rsa,然後按下Download
3.use the PuTTYgen to convert the key from the OpenSSH format to the PuTTY format.
將private key轉換為Putty可讀取的格式
按下Load,選擇C:\Temp\Azure\id_rsa 檔案
然後按下Save private key,將檔案儲存為C:\Temp\Azure\id_rsa.ppk
4.Configure SSH Keys Authentication for PuTTY
使用Pageant設定SSH KEY授權
啟動Pagent後,在系統右下角常駐程式區,在Pageant圖示按下右鍵選擇Add Key
選擇上一個步驟所產生的 id_rsa.ppk
5.Connect to Azure Linux VM with Putty
Host Name輸入 使用者帳號@VM的外部IP,例如 azureuser@13.67.65.46
Pageant does not load SSH-2 key generated with GitBash
https://stackoverflow.com/questions/27129904/pageant-does-not-load-ssh-2-key-generated-with-gitbash
How To Configure SSH Keys Authentication With PuTTY And Linux Server
https://putty.org.ru/articles/putty-ssh-key-auth.html