如何在没有屏幕的情况下在 Raspbian 上启用 SSH
你可以打开 SD 卡上的启动分区(FAT32 分区)并在该分区的根目录中创建一个名为 ssh 的空文件。确保文件名为 ssh 而不是 ssh.txt!
如果你在命令行中正确的工作目录中,使用
touch-ssh.sh
touch ssh在最近的 Ubuntu 版本上,这将切换到正确的目录并创建文件(但你需要手动挂载目录,例如使用你的文件管理器:
cd-and-touch-ssh.sh
cd /media/$USER/boot && touch ssh不要忘记在取出 SD 卡之前卸载启动驱动器。一旦你使用修改后的 SD 卡重启树莓派,SSH 将被启用,而无需你将键盘或屏幕连接到 Pi。
此方法已在 2018-11-13 版本的 Raspbian 上测试,适用于 Raspberry Pi 1、Raspberry Pi 2 和 Raspberry Pi 3。
感谢 Yahor 在 StackOverflow 上的原始解决方案!
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow