现在的位置: 首页 > 综合 > 正文

mac无法ssh localhost

2018年04月02日 ⁄ 综合 ⁄ 共 455字 ⁄ 字号 评论关闭

From: http://www.2cto.com/os/201203/123274.html

 

mac 无法ssh localhost,错误提示:bash: /usr/local/bin/ssh_session: Permission denied
在网上找了很久也没有找到解决方案,最后根据提示自己摸索如下:

1.编辑/etc/sshd_config文件,注释掉
#ForceCommand /usr/local/bin/ssh_session

2.启动sshd服务:
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

3.停止sshd服务:
sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist

4查看是否启动:
sudo launchctl list | grep ssh

如果看到下面的输出表示成功启动了:
--------------
- 0 com.openssh.sshd

5.最后ssh localhost 成功

抱歉!评论已关闭.