mac 开启 ssh

直接运行/usr/sbin/sshd出现

 

Could not load host key: /etc/ssh_host_rsa_key

Could not load host key: /etc/ssh_host_dsa_key

 

生成一下key

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

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

然后配置一下/etc/sshd_config(这个路径和linux上不同),端口,监听地址看一眼就知道了,然后再次输入

/usr/sbin/sshd -f /etc/sshd_config即可开启ssh服务

注意,mac os x遵循freebsd上的约定,默认root不能登陆ssh(而linux上是可以的),开启root允许登陆需要在

/etc/sshd_config中配置PermitRootLogin yes

 

posted @ 2015-03-02 18:12  nXqaL  阅读(1091)  评论(0编辑  收藏  举报