您的位置:首页 > 其它

NetBSD could not load host key: /etc/ssh/ssh_host_rsa_key 无法启动ssh的一个解决办法

2009-09-04 15:20 706 查看


could not load host key: /etc/ssh/ssh_host_rsa_key 无法启动ssh的一个解决办法

症状


# /usr/sbin/sshd

系统提示“Could not load host key: /etc/ssh/ssh_host_key

Could not load host key: /etc/ssh/ssh_host_rsa_key

Could not load host key: /etc/ssh/ssh_host_dsa_key

Disabling protocol version 1. Could not load host key

Disabling protocol version 2. Could not load host key

sshd: no hostkeys available — exiting”

大致的意思就是需要某个key什么的。

解决办法如下


#ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key

Generating public/private dsa key pair.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /etc/ssh/ssh_host_dsa_key.

Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.

The key fingerprint is:

xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx root@localhost.localdomain

#ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key

Generating public/private rkey pair.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /etc/ssh/ssh_host_rsa_key.

Your public key has been saved in /etc/ssh/ssh_host_dsa_rey.pub.

root@localhost.localdomain

#/usr/sbin/sshd

这时候,就可以在windows底下使用putty连接这台linux主机了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐