树莓派 SSH 访问被拒绝
我正在尝试使用 Raspberry )登录Raspberry Pi时,它会说访问被拒绝。
我有创建的 wpa_supplicant.conf 文件和ssh文件。这是其第一个启动。我正在使用最新版本的Raspbian Lite OS。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
最近,Raspbian 的默认用户设置发生了重大变化,导致大多数现有的在线教程无效。
本质上,默认的 pi 用户不再存在,因此您必须使用官方的 Imager 工具或在 microSD 卡的
boot
分区中创建一个userconf
文件,该文件应包含一行文本:用户名:哈希密码
,将username
替换为您想要的用户名(例如,pi
),并将hashed-password
替换为您想要的密码的哈希值。根据官方指南,最简单的方法是在终端(Linux 或 macOS)中运行以下命令:
同样,您应该将
password
替换为您想要的密码。进一步阅读:Raspberry Pi OS Bullseye 更新< /a> (2022-04-07)
Recently, the default user setup of Raspbian was significantly changed, rendering most existing online tutorials invalid.
In essence, the default
pi
user no longer exists, so you have to create it and set its password using either the official Imager tool or by creating auserconf
file in theboot
partition of your microSD card, which should contain a single line of text:username:hashed-password
, replacingusername
with the name of the user you want (e.g.,pi
) andhashed-password
with the hash of the password you want.According to the official guide, the easiest way to do this is by running the following in a terminal (Linux or macOS):
Again, you should replace
password
with the password you want here.Further reading: An update to Raspberry Pi OS Bullseye (2022-04-07)
默认用户名和密码对 Raspberry Pi 不再有效。
如果您尝试无头登录(没有显示器和键盘),您可以从 Raspberry Pi 进行登录成像仪本身。
在 Raspberry Pi Imager 中选择操作系统时,您会看到一个设置图标,您可以在其中
配置后,您可以继续刷新您的设备存储卡。
第一次启动时,您就可以开始使用了。
The default username and password are no longer valid for Raspberry Pi.
If you are trying to log in headlessly (without a monitor and keyboard), you can do it from Raspberry Pi Imager itself.
On selecting the OS in Raspberry Pi Imager, you get an icon of settings in which you can
After configuring, you can continue flashing your memory card.
And on first boot you will be good to go.
我已经解决了这个问题。您可以使用 Raspberry Pi Imager 轻松输入用户名和密码。
I have solved this problem. You can easily input your username and password with Raspberry Pi Imager.
确保使用如下所示的用户名和 IP 地址 ssh 到您的树莓派。
我错误地假设我的用户名是 pi 并且 IP 地址只能用主机名“raspberrypi”表示。
这是错误的。希望这有帮助。
Make sure to ssh to your raspberry pi with its username and ip address like below.
I had made the mistake of assuming my username was pi and the ip address can just be represented with hostname "raspberrypi".
Which is wrong. Hope this help.
一个简单的解决方案只需要一个步骤。
测试
refs
https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-a-user
A simpler solution only needs one step.
test
refs
https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-a-user
将刷写镜像时创建的用户添加到 ssh 组。
add the user you created when flashing the image to the ssh group.