Skip to main content

sshd no hostkeys available 修复

Today while trying to start ssh server on my WSL Ubuntu installation on command [ sshd -t ], 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

ssh-keygen -A

In the /etc/ssh/ folder, and the start the server

/etc/init.d/ssh start