Fix WSL2 SSH Error "sshd: no hostkeys available -- exiting"

Published: 19 January 2021
on channel: Sultan Kautsar
11,298
177

Today while trying to start ssh server on my WSL Ubuntu installation, I got this error:
sshd: no hostkeys available -- exiting

After searching on the web, I found that the solution was really simple, at least in this case.
I only needed to run:
sudo ssh-keygen -A

Then, start/restart the ssh service:
sudo service ssh start
sudo service ssh restart

Read more at:
https://rayatiga.com/blog/fix-sshd-no...

Chapters:
0:00 Starting WSL2
0:15 Checking SSH Service
0:30 SSH Got an Error
0:43 Fixing The Error
1:03 Starting SSH Again

Music in this video:
AIRGLOW – New Touch [Synthwave] 🎵 from Royalty Free Planet™

Thanks For Watching!


Watch video Fix WSL2 SSH Error "sshd: no hostkeys available -- exiting" online without registration, duration hours minute second in high quality. This video was added by user Sultan Kautsar 19 January 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 11,298 once and liked it 177 people.