gpt4 book ai didi

ssh - 树莓派 3,ssh 连接被远程 ip 端口 22 关闭

转载 作者:行者123 更新时间:2023-12-01 03:30:46 25 4
gpt4 key购买 nike

我看到很多帖子都有同样的问题,但没有答案或真正的解决方案。
我有 raspberry pi 3 并且我安装了最新版本的 rasbian。我既没有显示器也没有键盘,所以我想通过 SSH 设置我的树莓派。
我尝试连接已经 3 天了,但我总是收到此错误:

连接被 {ip} 端口 22 关闭

任何帮助将不胜感激!

最佳答案

似乎 Raspbian 的更新版本 disable ssh by default :

In the past, SSH was enabled by default, so people using their Pi headless could easily update their SD card to a new image. Switching SSH on or off has always required the use of raspi-config or the Raspberry Pi Configuration application, but to access those, you need a screen and keyboard connected to the Pi itself, which is not the case in headless applications. So we’ve provided a simple mechanism for enabling SSH before an image is booted.

The boot partition on a Pi should be accessible from any machine with an SD card reader, on Windows, Mac, or Linux. If you want to enable SSH, all you need to do is to put a file called ssh in the /boot/ directory. The contents of the file don’t matter: it can contain any text you like, or even nothing at all. When the Pi boots, it looks for this file; if it finds it, it enables SSH and then deletes the file. SSH can still be turned on or off from the Raspberry Pi Configuration application or raspi-config; this is simply an additional way to turn it on if you can’t easily run either of those applications.



所以要为一次启动启用 sshd touch /mnt/raspi/boot/ssh .

要永久启用 sshd,您可以运行 raspi-config并选择启动 SSHd。也应该有一种方法可以手动执行此操作,但我还没有弄清楚。

关于ssh - 树莓派 3,ssh 连接被远程 ip 端口 22 关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37906557/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com