WebHosting

Monday, June 29, 2026

Fixing “sshd: no hostkeys available -- exiting” in Ubuntu (VMware / Cloned VM)



If you’re trying to start SSH on Ubuntu and encounter this error:

sshd: no hostkeys available -- exiting.

Don’t worry — this is a common issue, especially when working with cloned virtual machines or golden images.

In this guide, we’ll break down:

  • ✅ What this error means
  • 🔍 Why it happens
  • ⚙️ Step-by-step fix
  • 🧠 Best practices for future

🚨 What Does This Error Mean?

SSH (Secure Shell) requires host keys to identify the server securely.

These keys are stored in:

/etc/ssh/ssh_host_*

If these keys are missing, SSH cannot start — resulting in:

sshd: no hostkeys available -- exiting.

🔍 Why This Happens

This issue typically occurs in these scenarios:

🧩 1. Cloned Virtual Machines

When you clone a VM, you may remove host keys intentionally to avoid duplication.

🧹 2. Golden Image Preparation

During template creation, admins often delete SSH keys for security reasons.

⚠️ 3. Manual Deletion or Misconfiguration

Accidental removal of /etc/ssh/ssh_host_* files.


⚙️ Step-by-Step Fix

🔹 Step 1: Generate New Host Keys

Run the following command:

sudo ssh-keygen -A

This will generate all required SSH host keys automatically.


🔹 Step 2: Restart SSH Service

sudo systemctl restart ssh

🔹 Step 3: Verify SSH Status

sudo systemctl status ssh

You should now see:

active (running)

🔹 Step 4: Confirm SSH is Listening

ss -tulnp | grep :22

If everything is working, SSH should be listening on port 22.


🔐 Test SSH Connection

From your host machine:

ssh username@your-ip-address

Example:

ssh shashwat@192.168.59.18

🧠 Best Practices (Important)

If you’re working with VMs, templates, or automation:

✅ Always regenerate SSH keys after cloning

sudo ssh-keygen -A

✅ Use cloud-init (Advanced)

Automate:

  • Hostname
  • SSH keys
  • Network config

✅ Never reuse SSH host keys across machines

This can lead to:

  • Security risks
  • SSH warnings
  • Connection issues

🎯 Summary

IssueFix
SSH not startingGenerate host keys
Error: no hostkeys availablesudo ssh-keygen -A
Service failingRestart SSH

Google App for Windows


 Google App for Windows 🔥 | Search Anything Instantly (Alt + Space Magic!)

Google has launched a powerful new tool for Windows users — the Google App for Windows, and it completely changes how you search on your PC! 🚀 With a simple shortcut (Alt + Space), you can instantly search everything — from your files and apps to Google Drive and the entire web — all in one place. This app works like a supercharged version of Spotlight search, bringing speed, AI, and smart features directly to your desktop. ⚡ Key Features 👉 Universal search (files, apps, web, Drive in one place) 👉 Instant access using Alt + Space shortcut 👉 Built-in Google Lens to search anything on your screen 👉 AI-powered answers with follow-up queries 👉 Floating, resizable search bar on desktop 👉 Dark mode support #GoogleAppWindows, #GoogleNewApp, #WindowsTools, #ProductivityTools, #AITools, #TechIndia, #GoogleLens, #SmartSearch, #WindowsTips, #TechUpdates, #FutureTech, #AIProductivity, #DesktopTools, #GoogleAI, #TechExplained,google app for windows, google windows app features, alt space shortcut windows, google lens windows pc, ai search windows, best windows productivity tools, google search app pc, windows spotlight alternative, google ai tools pc, new google app 2025, windows 11 tools, google drive search windows, desktop search app google, tech review google app, ai tools for windows

Featured Posts

Fixing “sshd: no hostkeys available -- exiting” in Ubuntu (VMware / Cloned VM)

If you’re trying to start SSH on Ubuntu and encounter this error: sshd: no hostkeys available -- exiting. Don’t worry — this is a common ...