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 成功


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM