Day 24: Securing Virtual Machine SSH Access

Опубликовано: 21 Июнь 2026
на канале: Otter Tech
37
0

🔐 Day 24: Securing Virtual Machine SSH Access | 100 Days of Cloud (Azure)

Welcome to Day 24 of the 100 Days of Cloud (Azure) series! In this lab, you’ll set up a Virtual Machine and configure secure, password-less SSH access using key-based authentication.

📌 Lab Objective:
Create an Azure VM and enable secure SSH access using an SSH key from the azure-client host.

🛠️ Task Requirements:

VM Name: nautilus-vm
Region: westus
Size: Standard_B1s
User: azureuser
Create SSH key (if not exists)
Enable password-less SSH access

💻 Step-by-Step Solution (Azure CLI):

🔹 1. Check/Create SSH Key (on azure-client)

ls /root/.ssh/id_rsa

👉 If not present:

ssh-keygen -t rsa -b 2048 -f /root/.ssh/id_rsa -N ""

🔹 2. Create Virtual Machine

az vm create \
--resource-group kml_rg_main-95e445e2c27d4ea6 \
--name nautilus-vm \
--location westus \
--image Ubuntu2204 \
--size Standard_B1s \
--os-disk-size-gb 30 \
--storage-sku Standard_LRS \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_rsa.pub

🔹 3. Get Public IP

az vm show \
--name nautilus-vm \
--resource-group kml_rg_main-95e445e2c27d4ea6 \
--show-details \
--query publicIps \
--output tsv

🔹 4. Verify SSH Access

ssh -i ~/.ssh/id_rsa azureuser@PUBLIC-IP

🔍 Expected Outcome:

✅ SSH login works without password
✅ Secure key-based authentication enabled

📚 What You’ll Learn:

SSH key generation and usage
Creating Azure VMs via CLI
Configuring secure SSH access
Password-less authentication setup
Cloud security best practices

🌟 Why This Lab Matters:
SSH key-based authentication is a critical security standard in cloud environments, widely used in DevOps automation and infrastructure management.

🎯 Series: 100 Days of Cloud (Azure)
Build real-world cloud skills step by step.

🔔 Follow OtterTech for more hands-on labs and practical tutorials!

#Azure #VirtualMachine #SSH #CloudSecurity #DevOps #Linux #CloudComputing #100DaysOfCloud #OtterTech #Day24