简体   繁体   English

Raspberry Pi3B上的无头SSH:连接被拒绝

[英]Headless SSH on Raspberry Pi3B: connection refused

Thanks for taking the time and helping me out. 感谢您抽出宝贵的时间来帮助我。

The Aim: 目的:

Heedlessly ssh into a Raspberry Pi 3B on my Win7 platform(s). 在我的Win7平台上毫不留神地陷入Raspberry Pi 3B。

The problem: 问题:

I have two Raspberry Pi 2 B's that I have set up in the past with no issues incl headless setup. 我有过去设置的两台Raspberry Pi 2 B,没有任何问题,包括无头设置。 I have a new Raspberry Pi 3B and cannot ssh into it at all. 我有一个新的Raspberry Pi 3B,根本无法使用它。 I have followed the exact same steps I have for my Pi 2B's with exception to the image. 除图像外,我遵循与Pi 2B完全相同的步骤。

What I have done so far: 到目前为止,我所做的是:

  1. Download the latest Raspbian Jessie Image and format the Sd card using Win32DiskImager. 下载最新的Raspbian Jessie映像并使用Win32DiskImager格式化SD卡。

  2. Power up the Raspberry 给树莓通电

  3. Ping the raspberry successfully using the Pi's IP address. 使用Pi的IP地址成功对树莓派执行Ping操作。

  4. Open Putty and enter the IP on port 22 (not that the port should matter) 打开Putty并在端口22上输入IP(不是端口应该重要)

  5. At this point when I try click "Open" after having entered the Pi's IP address I get the following error: "Connection Refused" 此时,当我尝试输入Pi的IP地址后单击“打开”时,出现以下错误:“连接被拒绝”

  6. I then used a Screen and keyboard to boot the Pi 3B. 然后,我使用屏幕和键盘启动Pi 3B。 Once booted I opened terminal and entered "sudo raspi-config", where I then enabled SSH manually. 一旦启动,我打开终端并输入“ sudo raspi-config”,然后在其中手动启用SSH。

  7. I unplugged everything from the Pi3, plugged the LAN cable back into my laptop and Pi3 and powered up the Pi3B. 我从Pi3拔下了所有插头,将LAN电缆插回了笔记本电脑和Pi3,并给Pi3B通电。

  8. I could still ping the Pi 我仍然可以对Pi进行ping操作

  9. Using Putty and the Pi3B's IP address I then clicked "open" and the following error came up: "Network Error: Software cause connection abort" 然后,使用Putty和Pi3B的IP地址单击“打开”,出现以下错误:“网络错误:软件导致连接中断”

EDIT: 编辑:

I have now also added a router to the setup, checked up what the ip of the pi is through the router and tried connecting with putty onto the pi, but I still get "Network Error: Connection Refused" 现在,我还向设置中添加了一个路由器,检查了pi的IP是通过路由器通过的,并尝试将腻子连接到pi上,但仍然出现“网络错误:连接被拒绝”

I am running out of ideas, any help would be appreciated. 我的想法不多了,任何帮助将不胜感激。 Thank you Misha 谢谢米莎

After comically large amounts of googling and hassle I found a solution here: https://www.raspberrypi.org/blog/a-security-update-for-raspbian-pixel/ 经过大量可笑的谷歌搜索和麻烦之后,我在这里找到了解决方案: https : //www.raspberrypi.org/blog/a-security-update-for-raspbian-pixel/

With the RPi3B and 11-01-2017 Raspbian Jessie combo (I dont know with which one the issue lies) one has to add a blank file named "ssh" into the boot directory of the SD card. 使用RPi3B和2017年1月1日的Raspbian Jessie组合(我不知道问题出在哪一个),必须将一个名为“ ssh”的空白文件添加到SD卡的引导目录中。 This can be done on your Windows platform. 这可以在Windows平台上完成。 Ensure that the file has no file extensions, because if it has any file extensions it wont work. 确保文件没有文件扩展名,因为如果文件扩展名不起作用。 Good practice anyway to have your file extensions showing in any case. 无论如何,无论如何都要显示文件扩展名。

Hope this helps anyone else. 希望这对其他人有帮助。

I have followed the exact same steps I have for my Pi 2B's... 我遵循了与Pi 2B完全相同的步骤...

What you didn't do is read the release notes of all the raspbian versions between your old and new image before following those steps. 您没有做的就是在遵循这些步骤之前,阅读了新旧映像之间所有raspbian版本的发行说明。 In one of them it says that you have to put a file (can be empty) with name ssh in the boot partition . 其中一个提示您必须在引导分区中放入一个名称为ssh的文件(可以为空)。 Upon first boot ssh will be enabled and the file removed. 首次启动时,将启用ssh并删除文件。

(Don't do what I did. I put the file 'ssh' in the boot directory of the main partition, but that turned out to be the mount point for the (small) boot partition , hiding the file 'ssh' at mount and rendering the whole exercise without effect. It took me some time before I found my mistake. You have to put the file in the small boot partition itself.) (不要做我做的事情。我将文件“ ssh”放在主分区的引导目录中,但是原来是(小)引导分区的安装点,在安装时隐藏了文件“ ssh”并使整个练习无效。我花了一些时间才发现自己的错误。您必须将文件放在小启动分区本身中。)

here is what you do go to Network & Sharing center & click on the Ethernet connection to Raspberry Pi then IPv4 & set everything to automatically(obtaining IP & DNS server) then go to details of the Ethernet & check the autoconfiguration IPv4 & note that down. 这是您要做的事情,前往网络和共享中心,单击与Raspberry Pi的以太网连接,然后单击IPv4并将所有内容设置为自动(获取IP和DNS服务器),然后转到以太网的详细信息并检查自动配置IPv4并注意, 。

remove sd card from Ra-Pi and mount to laptop, go to the the boot folder & open the cmdline.txt file, & add after root wait "ip=(autoconfiguration IPv4 + 1 on the last digit)" & save. 从Ra-Pi移除SD卡并安装到笔记本电脑,转到启动文件夹并打开cmdline.txt文件,并在root等待“ ip =(autoconfiguration IPv4 + 1 on the last digit)”后添加并保存。

this worked for me 这对我有用

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

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