How to use SSH to access the Raspberry Pi without know the Wi-Fi IP address All In One
如何在不知道 Wi-Fi IP 地址的情况下使用 SSH 访问树莓派
没有显示器,不知道树莓派 IP 地址的情况下,如何通过 SSH 远程访问树莓派的终极解决方案
1. 必备条件
- 有一个家庭 Wi-Fi,有互联网访问; (PS: 也可以没有互联网访问, 如果有离线的
系统镜像和 Raspberry Pi Imager工具) - SD 卡读卡器; (PS: 也可以没有, 如果电脑自带了读卡器)
- 一个 5V/3A 的 USB 电源适配器
- 一个树莓派 (3B / 3B+ / 4B)等
- 一台电脑
2. 前置条件
- 准备一个新的
SD 内存卡,选择 8GB ~ 256 GB, 推荐32GB/64GB, 太大一般也用不了 - 下载并安装
Raspberry Pi Imager工具 - 下载一个 64 位
Raspberry Pi OS离线镜像,如果你网速快也可选择在线下载
# rpi-imager
$ sudo apt install rpi-imager
https://downloads.raspberrypi.org/imager/imager_latest.dmg

3. 操作步骤
安装
Headless Raspberry Pi模式
- 选择 SD 卡, 使用
Raspberry Pi Imager先格式化 SD 卡,然后选择一个要安装的系统(离线/在线) - 选择安装系统后,点击右下角的
Advanced options高级选项菜单 - 镜像自定义选项,选择
to always use总是如此 - 配置主机名为默认的
raspberrypi.local,当然也可以自定义,没必要也不好记住 - 开启 SSH,选择使用
密码授权 - 配置用户名
pi与密码raspberry - 配置无线网
Wi-Fi名称与密码,国家选择CN - 配置本地化,时区选择
Asia/Shanghai, 键盘布局选择us美式 - 永久性设置,默认全部选择即可
- play sound 播放声音
- eject media 退出媒体
- telemetry 遥测/远程控制
4. 图解教程
描述 |
截图 |
|---|---|
| 格式化 SD 卡 | ![]() |
| 步骤 1 ~ 6 | ![]() |
| 步骤 6 ~ 7 | ![]() |
| 步骤 7 ~ 8 | ![]() |
https://www.raspberrypi.com/documentation/computers/getting-started.html
Headless Raspberry Pi
If you do not use a monitor or keyboard to run your Raspberry Pi (known as headless), but you still need to do some wireless setup, there is a facility to enable wireless networking and SSH when creating an image.
如果您不使用显示器或键盘来运行您的 Raspberry Pi(称为无头),但您仍需要进行一些无线设置,则可以使用一种工具在创建映像时启用无线网络和 SSH。
# SSH 连接 Raspberry Pi 无需通过 ip 地址访问,只需要使用默认的`用户名@主机名`即可
$ ssh pi@raspberrypi.local
$ ping raspberrypi.local
# 否则,SSH 连接 Raspberry Pi 就需要使用分配的 ip 地址访问
$ ssh pi@192.168.18.135
static ip address: 192.168.18.135

??? SSH 关闭了

(? 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
Raspberry Pi Documentation
https://www.raspberrypi.com/documentation/
https://www.raspberrypi.com/documentation/computers/config_txt.html
https://www.raspberrypi.com/documentation/computers/configuration.html#the-boot-folder
userconf.txt
https://www.raspberrypi.com/documentation/computers/getting-started.html#advanced-options
refs
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 ?️,侵权必究⚠️!



