openssh如何配置启动sshd问题

tngou 发布于 2012/12/08 14:52
阅读 9K+
收藏 0

安装openssh是自动安装的。运行


sshd start
出现:
sshd re-exec requires execution with an absolute path

再运行

/usr/sbin/sshd
出现
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
于是我就用
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
 ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key

在上面设置中,如果设置了密码,运行

/usr/sbin/sshd
还是出现

Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.

如果不设置密码,就可以正常运行,这是什么原因呀。都研究了两三天了,还没有搞定。



加载中
0
vigiles
vigiles

这个问题半年没人回答,不知道楼主解决了没有?

0
vigiles
vigiles
我在ubuntu10.04中用的
    zlib-1.2.5.1.tar.gz
    openssl-1.0.0d.tar.gz
    openssh-5.6p1.tar.gz

使用非root用户,安装三个文件没啥问题,但执行sudo sshd时就出现和你一样的错误

0
vigiles
vigiles
根据你的提示执行:

    hb@hb-ubuntu:/usr/local/sbin$ ssh-keygen -t dsa -f
    usr/local/etc/ssh_host_dsa_keyGenerating public/private dsa key pair.
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    open usr/local/etc/ssh_host_dsa_key failed: No such file or directory.
    Saving the key failed: usr/local/etc/ssh_host_dsa_key.
这个错误又是咋回事?


0
首席安全砖家
首席安全砖家
  我也遇到了.. 
0
xiaocao000
xiaocao000
# cd /etc/rc.d
# ./sshd restart
返回顶部
顶部