连接到 raspberry pi 时 ssh 文件编号错误
ssh bad file number when connection to raspberry pi
我刚刚在 raspberry pi 上安装了 Ubuntu(Wheezy) 的新副本,现在我正尝试通过 [=23] 中的 SSH 从我的 windows 桌面 SSH 进入它=] bash。当我尝试时它告诉我:
>ssh 192.168.0.105
connect to host 192.168.0.105 port 22: Bad file number
当我尝试端口 443 时:
>ssh -v 192.168.0.105 -p 443
OpenSSH_6.6.1, OpenSSL 1.0.1i 6 Aug 2014
debug1: Connecting to 192.168.0.105 [192.168.0.105] port 443.
debug1: connect to address 192.168.0.105 port 443: Attempt to connect timed out without establishing a connection
ssh: connect to host 192.168.0.105 port 443: Bad file number
我找到了一些关于如何在人们连接到 github 等问题时解决此问题的帖子,但没有针对本地网络的解决方案。我检查了路由器,但找不到任何阻塞端口 22 的东西。我还在测试时禁用了 windows 电脑上的防火墙。如果有人能解释为什么我遇到这个问题,以及如何解决它,我将不胜感激。
我发现我的 pi 连接到访客网络而不是主网络,并且访客网络显然阻止了所有 ssh 端口。
另一种可能是树莓派没有开启SSH。 2016年11月之后的Raspbian就是这种情况。
https://www.raspberrypi.org/documentation/remote-access/ssh
As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually.
为无头机器启用 SSH:
For headless setup, SSH can be enabled by placing a file named ssh
, without any extension, onto the boot partition of the SD card.
我刚刚在 raspberry pi 上安装了 Ubuntu(Wheezy) 的新副本,现在我正尝试通过 [=23] 中的 SSH 从我的 windows 桌面 SSH 进入它=] bash。当我尝试时它告诉我:
>ssh 192.168.0.105
connect to host 192.168.0.105 port 22: Bad file number
当我尝试端口 443 时:
>ssh -v 192.168.0.105 -p 443
OpenSSH_6.6.1, OpenSSL 1.0.1i 6 Aug 2014
debug1: Connecting to 192.168.0.105 [192.168.0.105] port 443.
debug1: connect to address 192.168.0.105 port 443: Attempt to connect timed out without establishing a connection
ssh: connect to host 192.168.0.105 port 443: Bad file number
我找到了一些关于如何在人们连接到 github 等问题时解决此问题的帖子,但没有针对本地网络的解决方案。我检查了路由器,但找不到任何阻塞端口 22 的东西。我还在测试时禁用了 windows 电脑上的防火墙。如果有人能解释为什么我遇到这个问题,以及如何解决它,我将不胜感激。
我发现我的 pi 连接到访客网络而不是主网络,并且访客网络显然阻止了所有 ssh 端口。
另一种可能是树莓派没有开启SSH。 2016年11月之后的Raspbian就是这种情况。
https://www.raspberrypi.org/documentation/remote-access/ssh
As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually.
为无头机器启用 SSH:
For headless setup, SSH can be enabled by placing a file named
ssh
, without any extension, onto the boot partition of the SD card.