Mac OS X 开启 sshd

运行 /usr/sbin/sshd ,系统报错:

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

生成所需的密钥

/usr/bin/ssh-keygen -t rsa -f /etc/ssh_host_rsa_key
/usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key

然后就可以启动 sshd 服务了:

/usr/sbin/sshd

Tags:

3 comments

  1. had you try it ??

    why there is same command ??
    /usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key

    /usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key

  2. Sorry!
    It’s a mistake.
    Should be rsa and dsa.


    jimi:

    had you try it ??
    why there is same command ??
    /usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key
    /usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key

Leave a Reply

Your email address will not be published.

*