简体   繁体   English

连接到树莓派时ssh文件编号错误

[英]ssh bad file number when connection to raspberry pi

I just installed a fresh copy of Ubuntu(Wheezy) on my raspberry pi and I am now trying to SSH into it from my windows desktop via SSH in git bash. 我刚刚在树莓派上安装了Ubuntu(Wheezy)的新副本,现在我正尝试通过git bash中的SSH从Windows桌面通过SSH SSH到它。 When I try it tells me: 当我尝试时,它告诉我:

>ssh 192.168.0.105
connect to host 192.168.0.105 port 22: Bad file number

When I try port 443: 当我尝试端口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

I found a few posts on how to fix this when people had problems connection to github etc, but no solutions for just a local network. 当人们无法连接到github等问题时,我发现了一些有关如何解决此问题的帖子,但没有针对本地网络的解决方案。 I checked the router and cannot find anything that is blocking port 22. I also disabled the firewall on my windows pc while testing. 我检查了路由器,但找不到阻塞端口22的任何东西。我还在测试时禁用了Windows pc上的防火墙。 If someone could explain why Im having this problem, and possibly how to fix it I would appreciate it. 如果有人可以解释为什么我有这个问题,以及可能如何解决,我将不胜感激。

我发现我的pi连接到来宾网络而不是主网络,并且来宾网络显然阻塞了所有ssh端口。

Another possibility is that SSH is not enabled on the Pi. 另一种可能性是在Pi上未启用SSH。 This is the case with the Raspbian after November 2016. Raspbian在2016年11月之后就是这种情况。

https://www.raspberrypi.org/documentation/remote-access/ssh https://www.raspberrypi.org/documentation/remote-access/ssh

As of the November 2016 release, Raspbian has the SSH server disabled by default. 从2016年11月版本开始,Raspbian默认禁用SSH服务器。 You will have to enable it manually. 您将必须手动启用它。

To enable SSH for headless machines: 为无头计算机启用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. 对于无头设置,可以通过将名为ssh的文件(没有任何扩展名)放置到SD卡的引导分区上来启用SSH。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM