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

时间: 2024-08-03 07:17:28

mac 无法ssh localhost,错误提示:bash: /usr/local/bin/ssh_session: Permission denied的相关文章

CentOS安装软件出现错误:bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

CentOS安装软件出现错误: bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directorygoogle了一把才发现是64位系统中安装了32位程序解决方法:yum install glibc.i686 重新安装以后还有如下类系错误 再继续安装包 error while loading shared libraries: libstdc++.so.6: cannot open

-bash: /usr/local/bin/react-native: No such file or directory

执行react-native run-android/run-ios的时候出现 解释一下出现问题的大背景:本来这个命令是能运行的,只因为我再网上下载了一个开源的react-native项目,然后执行命令npm install插入node_modules模块后,不仅这个项目无法执行运行命令,其他的项目也不可以了. 大概原因:可能是我再插入node_modules模块的时候把全局设置删掉了.所以解决办法是再插入一遍就ok了. 解决办法:执行如下命令 sudo npm install -g react

mac 无法ssh localhost

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.

-bash: /usr/local/Java/jdk1.8.0_241/bin/java: No such file or directory

错误: [[email protected] Java]# java -version -bash: /usr/local/Java/jdk1.8.0_241/bin/java: No such file or directory 原因:64位操作系统装了32为,重新装一个64位即可,在Linux中64位只能装64位 Linux中查看位数的命令: [[email protected] ~]# getconf LONG_BIT 64 [[email protected] ~]# 原文地址:http

错误提示:Wrong Local header signature: 0xE011CFD0

导入Excel时出现错误,错误提示:Wrong Local header signature: 0xE011CFD0,这个是excel的扩展名问题,.xlsx  应该XSSFWorkbook workbook = new XSSFWorkbook(file);而xls应该用 HSSFWorkbook workbook = new HSSFWorkbook(file);

mac下/usr/local/bin No such file or directory问题解决

在对composer进行全局配置时,执行 sudo mv composer.phar /usr/local/bin/composer 时,mac报错:/usr/local/bin No such file or directory . 分析原因,在finder中command+shift+G进入目录,确实也找不到 /usr/local/bin/composer ,包括在终端中也进不到该目录. 参考:https://stackoverflow.com/questions/25654731/usr-

/usr/local/bin is not writable mac

sudo chown -R yourusename:admin /usr/local/bin Mac-Pro:local user$ brew install imagemagick Error: You must `brew link jpeg' before imagemagick can be installed Mac-Pro:local user$ brew link jpeg Linking /usr/local/Cellar/jpeg/8d... Error: Could not

error: /usr/include/stdio.h: Permission denied 的一种情况分析

代码: #include <stdio.h> int main(){ printf ("hello long size %d\n",sizeof(long)); } 很简单,测试是否能够编译通过对比 在root的用户下编译正常通过 在其他用户测试不通过 点击(此处)折叠或打开 ~> gcc test.c test.c:1:19: error: /usr/include/stdio.h: Permission denied test.c: In function 'ma

全局安装npm i -g @vue/cli的时候一直出现File exists: /usr/local/bin/vue

最近用vue cli3.0全局安装的时候,一直报错 如下图: 其实他的下面一句已经提示我们了(Remove the existing file and try again, or run npm),删除现有的文件并且重试 直接前往/usr/local/bin/vue 找到这个vue文件然后删除,在重新全局安装,就可以了 原文地址:https://www.cnblogs.com/yhhBKY/p/12187433.html