How would you like to connect to your virtual machines securely? Did you know that VMs created using SSH keys are by default configured with passwords disabled, which greatly increases the difficulty of brute-force guessing attacks?
In this step by step guide to Create and use an SSH public-private key pair for Linux VMs in Azure, I show you how to implement these secured practices in a heart-beat using your favourite PuTTY software.
What you need to do first;
- Download Putty
- Create Virtual Machine
- Generate Private Key
- Load Private Key in PuTTY
- Save Key as PuTTY’s own format (.pkk)
- Add Private Key to Putty
On Azure
Generate new key pair
An SSH key pair contains both a public key and a private key. Azure doesn’t store the private key. After the SSH key resource is created, you won’t be able to download the private key again
Save Private Key to save it in PuTTY’s own format
click save private key to save it in PuTTY’s own format
Add Key to PuTTY
Connect to VM with SSH using Putty
login as: emcrsrvusr Authenticating with public key "imported-openssh-key" Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.13.0-1022-azure x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage System information as of Wed May 4 08:59:32 UTC 2022 System load: 0.08 Processes: 119 Usage of /: 4.9% of 28.90GB Users logged in: 0 Memory usage: 3% IPv4 address for eth0: 172.16.10.4 Swap usage: 0% 1 update can be applied immediately. To see these additional updates run: apt list --upgradable The list of available updates is more than a week old. To check for new updates run: sudo apt update The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. To run a command as administrator (user "root"), use "sudo". See "man sudo_root" for details. emcrsrvusr@org-eunorth-production-nva-vm01:~$