忘记树莓派密码怎么办?
2015-01-23 11:58
183 查看
原文连接:http://www.raspberrypi-spy.co.uk/2014/08/how-to-reset-a-forgotten-raspberry-pi-password/
大致过程是这样的:
1、首先将sd卡从树莓派取出,
2、在另一台电脑上,修改初始化进程为bin目录下的sh;
3、然后插入树莓派启动起来,启动后会停留在命令行,在此通过passwd加你的用户名来设置密码(即使root也可以在此修改,这里之前是否初始化过root密码不太确定)
4、树莓派关机,取出sd卡,插入另一台电脑,恢复启动文件,修改密码过程完成
详细步骤看翻译吧
翻译如下:
Power down the Pi and remove the SD card. Insert it into your PC.
将树莓派关机,移除sd卡,插入到你的电脑
The boot partition should be visible and contain a file named “cmdline.txt”. Edit this file in a text editor and add the following to the end of the existing text :
启动部分是可见的,并包含一个名为“cmdline.txt”的文件。在编辑器中编辑这个文本,并将下文插入到已有文本的最后
If the original content was :
如果原文是这样的:
it should now look like :
那么编辑后应该是这样的:
Make sure it is all one line! Save the text file and eject the SD card from the PC.
确保所有内容在同一行。保存文本内容,从pi出取出sd卡
Insert the card into a Pi that is connected to a monitor and keyboard. Power up the Pi. There may be a delay but you should be presented with a flashing cursor.
将sd卡插入树莓派(我们在这里需要连上显示器和键盘)。将树莓派开机,估计在显示闪动的光标前需要等一会。
At the prompt type the following command :
在标识符后,输入以下命令:
You will then be prompted for a new password. Enter it carefully and press the [Return] key. It will now ask you to retype the password.
你会被提示输入一个新的密码,请仔细输入后并敲下回车键。系统会提示你再次确认输入密码
The password has been changed.
这样密码就修改完成了
Now type the following commands :
现在输入以下命令去同步并执行初始化程序
The Pi will continue to boot and return you to the normal command line prompt.
树莓派会继续启动
Shutdown the Pi and power it off.
关掉树莓派并且断电
Using the PC edit the “cmdline.txt” file again and remove the “init=/bin/sh” text you added in Step 2.
用电脑再次编辑这个文本:把我们在第二步加入的最后数据删除
You can now return the SD card to your Pi, reboot and use the new password.
现在你可以插入sd卡到你的树莓派啦,再次启动就可以使用新的密码啦。
大致过程是这样的:
1、首先将sd卡从树莓派取出,
2、在另一台电脑上,修改初始化进程为bin目录下的sh;
3、然后插入树莓派启动起来,启动后会停留在命令行,在此通过passwd加你的用户名来设置密码(即使root也可以在此修改,这里之前是否初始化过root密码不太确定)
4、树莓派关机,取出sd卡,插入另一台电脑,恢复启动文件,修改密码过程完成
详细步骤看翻译吧
翻译如下:
Step 1 – Grab The SD Card
步骤1-取出sd卡Power down the Pi and remove the SD card. Insert it into your PC.
将树莓派关机,移除sd卡,插入到你的电脑
Step 2 – Edit cmdline.txt
步骤2-编辑cmdline.txtThe boot partition should be visible and contain a file named “cmdline.txt”. Edit this file in a text editor and add the following to the end of the existing text :
启动部分是可见的,并包含一个名为“cmdline.txt”的文件。在编辑器中编辑这个文本,并将下文插入到已有文本的最后
init=/bin/sh
If the original content was :
如果原文是这样的:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
it should now look like :
那么编辑后应该是这样的:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait init=/bin/sh
Make sure it is all one line! Save the text file and eject the SD card from the PC.
确保所有内容在同一行。保存文本内容,从pi出取出sd卡
Step 3 – Reset the Password
步骤3-重设密码Insert the card into a Pi that is connected to a monitor and keyboard. Power up the Pi. There may be a delay but you should be presented with a flashing cursor.
将sd卡插入树莓派(我们在这里需要连上显示器和键盘)。将树莓派开机,估计在显示闪动的光标前需要等一会。
At the prompt type the following command :
在标识符后,输入以下命令:
passwd pi
You will then be prompted for a new password. Enter it carefully and press the [Return] key. It will now ask you to retype the password.
你会被提示输入一个新的密码,请仔细输入后并敲下回车键。系统会提示你再次确认输入密码
The password has been changed.
这样密码就修改完成了
Now type the following commands :
现在输入以下命令去同步并执行初始化程序
sync exec /sbin/init
The Pi will continue to boot and return you to the normal command line prompt.
树莓派会继续启动
Shutdown the Pi and power it off.
关掉树莓派并且断电
sudo halt
Step 4 – Edit cmdline.txt
第四步-编辑cmdline.txt文本Using the PC edit the “cmdline.txt” file again and remove the “init=/bin/sh” text you added in Step 2.
用电脑再次编辑这个文本:把我们在第二步加入的最后数据删除
You can now return the SD card to your Pi, reboot and use the new password.
现在你可以插入sd卡到你的树莓派啦,再次启动就可以使用新的密码啦。
相关文章推荐
- linux系统上mysql忘记root密码怎么办
- 忘记了Mysql的root用户的密码,怎么办?
- Linux下忘记root密码怎么办?
- mysql忘记密码怎么办(windows linux)
- lnmp忘记mysql密码怎么办?
- mac电脑密码忘记怎么办? 分类: mac电脑操作 2014-12-05 11:11 159人阅读 评论(0) 收藏
- mysql忘记密码怎么办
- 安装SUSE11的服务器,当忘记Linux的root账户密码时怎么办?
- MACMini MACPro iMAC OS X 如果我忘记了我的账户密码 我该怎么办?
- mysql密码忘记,怎么办?
- 忘记了mysql密码怎么办
- 忘记开机密码怎么办
- 忘记root密码怎么办?
- 电脑忘记开机密码怎么办
- fedora 忘记密码怎么办?
- mac安装mysql初始密码忘记怎么办
- django忘记密码怎么办!
- win管理员忘记密码了怎么办
- 请教一个问题?忘记登录系统密码了,应该怎么办?
- sql2008忘记密码怎么办