Password Lockout on 3.5.0


#1

Password Lockout on my Pi 3.5.0 on my bench… i cannot access for some reason… unsure why or what happened… been at least 7 weeks since i last logged into the Pi…

Stumped.

Any suggestions on password recovery without redoing the image?


#2

Describe what you mean by “cannot access”


#3

Somehow my FlightAware password for the login “pi” on my Pi … does not let me into the Pi menu anymore.
Odd it worked 2 months ago, last time i logged in.
Have i been hacked, back doored, or password is corrupt?
Is there a reset?


#4

With physical access to the sdcard you can of course reset it, but it is fiddly. if you don’t have local changes you care about a much simpler approach is to just reimage the whole card and start afresh.


#5

Can you give me the manual “fiddly” instructions that you would have. I’d rather not reset my SD card.


#6

Remove the sdcard, mount the second partition on another system (you will need something that understands ext4 filesystems e.g. another linux box)

Edit etc/shadow on the mounted filesystem and remove the crypted password for the “pi” user in the second field so it looks something like pi::17329:0:9999:7::: (the numbers will probably be different on your system - the important thing is the empty second field)

save, unmount, replace sdcard. Now you should be able to log in as “pi” with no password.


#7

Thank you Oliver
This post should be STICKY


#8

If you dont have a computer running linux, no problem. You can write Raspbian Pixel x86 image on a USB Flash, and boot your Win/Mac computer from USB Flash stick, running Linux.

(1) On Windows/Mac laptop, download
"2016-12-13-pixel-x86-jessie.iso"
from: https://www.raspberrypi.org/blog/pixel-pc-mac/3

(2) Plug-in a USB flash memory stick (8Gb or more) in laptop/desktop and format it.

(3) Write the downloaded .iso image to USB flash memory stick using Win32 disk imager or etcher.

(4) Shutdown laptop/desktop, and power up again. At start up, enter option to select boot device, and select USB flash memory as the boot device and boot from it into a Raspbian Pixel style desktop.
Different models of Laptop/Desktop use different methods to get into boot device selection. Most popular is to Press F12. On some models Escape then F9. Some Models may have still a different method to get into boot device selection at startup.

NOTE: In Win 8 and Win 10, you have to go to control panel >> power options and uncheck the box for “fast startup”, else you wont be able to go to boot menu to choose boot from USB flash memory.

(5) If Pixel x86’s native file manager does not show USB flash and microSD card, install “dolphin” file manager to see all drives (all hard drives, USB flash, and microSD card).


#9

How to disable fast startup in Windows 8 and 10 to enable access to boot menu

Go to Windows Control Panel, and click “Hardware and Sound”. Click “Change what the power buttons do” under Power Options.

Disable fast startup in Win 8 and 10 (1)

At the top of the window that appears, click the “Change settings that are currently unavailable” link. Scroll down and uncheck the “Turn on fast start-up (recommended)” option. Click “Save changes” to save your changes.

The next time you reboot, you can go to boot menu by pressing F12, or Esc, or F9, depending on your computer’s bios.

Disable fast startup in Win 8 and 10 (2)


#10

A NEWER PIXEL x86 IMAGE, COMPATIBLE FOR BOOT ON OLDER (MBR BIOS) AND NEWER (UEFI) MACHINES
I have tested “2016-12-13-pixel-x86-jessie.iso” written on USB Flash Stick on many Windows computers, and found that on newer machines, even after choosing option “Boot from USB Storage Device”, the computer did not boot from USB Flash Stick. I Googled and found that newer machines have UEFI Boot, while older machines have BIOS MBR Boot. The “2016-12-13-pixel-x86-jessie.iso” unfortunately does not boot from UEFI.

In June 2017, raspberry pi foundation has released an installable image of PIXEL x86. I have tested it on older and newer computers and it boots from all. This image has a hybrid boot system, i.e. it can boot from both BIOS MBR (older computers) and UEFI (newer computers). It is also a “Live CD” i.e. you have option to either (1) run the PIxel x86 from the burned image on USB Flash Stick, or (2) install Pixel x86 on Hard Drive from the USB Flash Stick.

When booted, this image presents both these options. Since here we are not interested to install it on hard drive, the option to be used is “*Run With Persistance”, which is also the default option. Please do NOT choose “Install” or “Graphical Install”, else you may wipe out you Windows/Mac OS from the Hard Disk !!!

Web Page: (scroll to heading “ONE MORE THING…”)

Pixel x86 Image (New) Download link:
http://downloads.raspberrypi.org/rpd_x86/images/rpd_x86-2017-06-23/2017-06-22-rpd-x86-jessie.iso


#11

Will a running copy of Raspbian on another Pi with a SD card reader to edit the off the Flightware 3.5.0 Pi file do the trick ?


#12

Theoretically your idea should work, but I have never tried it.
You are smart to think of this very easy solution.


#13

Ok, great for the feedback! Very kind of you for your help…
I just built a Raspbian Pi.

One more Q : Once I insert the USB SD card reader into the Raspbian Pi what would the mounting command for the USB reader?

I am new to Raspbian.


#14

As I told you, I have never tried this. Just to see how it goes, I did following, and I think I hit the solution. You dont have to mount USB reader. It is mounted automatically when you plug it in the Pi’s USB port.

Here is how I found it:

I have a spare card with Raspbian Stretch.
I slipped it into a card reader and plugged-in the USB port of RPi running Piaware 3.5.1 (SD Card image).
First thing I did was to check if the microSD Card has been detected. The Pi detected the card reader as shown in line 2. I used another card reader, and the card reader manufacturer’s name was also displayed in line 2.

Now I checked folder media, and found a new folder “usb” there

now I entered dir /media/usb and checked what is there. I found two partitions sda1 and sda2. Normally sda1 is boot partition and sda2 is files partition. I checked both, and found all files and folders of microSD card in those two folders.

pi@piaware:~$ cd /media/usb
pi@piaware:/media/usb$ ls
sda1  sda2

pi@piaware:/media/usb$ ls sda1
bcm2708-rpi-0-w.dtb     config.txt     LICENCE.broadcom
bcm2708-rpi-b.dtb       COPYING.linux  LICENSE.oracle
bcm2708-rpi-b-plus.dtb  fixup_cd.dat   overlays
bcm2708-rpi-cm.dtb      fixup.dat      start_cd.elf
bcm2709-rpi-2-b.dtb     fixup_db.dat   start_db.elf
bcm2710-rpi-3-b.dtb     fixup_x.dat    start.elf
bcm2710-rpi-cm3.dtb     issue.txt      start_x.elf
bootcode.bin            kernel7.img    System Volume Information
cmdline.txt             kernel.img


pi@piaware:/media/usb$ ls sda2
bin   dev  home  lost+found  mnt  proc  run   srv  tmp  var
boot  etc  lib   media       opt  root  sbin  sys  usr

To make sure sda1 & sda2 DO NOT show files of running microSD card (Piaware 3.5.1 SD card image), and is showing the files of microSD card in USB card reader, I made following two checks
.

(1) The microSD card I am checking is Raspbian Stretch image, so in boot sector (sda1), file piaware-config should not exist.

pi@piaware:/media/usb$ ls sda1
bcm2708-rpi-0-w.dtb     config.txt     LICENCE.broadcom
bcm2708-rpi-b.dtb       COPYING.linux  LICENSE.oracle
bcm2708-rpi-b-plus.dtb  fixup_cd.dat   overlays
bcm2708-rpi-cm.dtb      fixup.dat      start_cd.elf
bcm2709-rpi-2-b.dtb     fixup_db.dat   start_db.elf
bcm2710-rpi-3-b.dtb     fixup_x.dat    start.elf
bcm2710-rpi-cm3.dtb     issue.txt      start_x.elf
bootcode.bin            kernel7.img    System Volume Information
cmdline.txt             kernel.img

.
(2) Checked contents of file issue.txt, and found date of issue and details pertain to Raspbian Stretch.

pi@piaware:/media/usb$ cat sda1/issue.txt
Raspberry Pi reference 2017-09-07
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 496e41575eeb9fa13f394ffb407b7bc1d00b21c2, stage2

By above two checks, I am convinced the partitions /media/usb/sda1 and /media/usb/sda2 are for the microSD card in the USB card reader.


#15

I don’t get why you need to do this if it’s a fresh install. If it’s a fresh install, you know what the password is.


#16

STEP-BY-STEP METHOD USING ANOTHER PI
My last post is TL;DR (too long, difficult to read). Also instructions and concepts are split in many posts. Here is final summarized method

Contributors: Oliver (obj), matthewsimons, and abcd567

(1) Remove the microSD card from you Pi, slip it in to a USB card reader, and plug card reader into USB Port of another Pi running Raspbian or Piaware.

(2) Edit file shadow and delete crypted password of pi

sudo nano /media/usb/sda2/etc/shadow

#Now remove the crypted password for the “pi” user in the second field 
#so it looks something like pi::17329:0:9999:7::: 
#the numbers will probably be different on your system
#the important thing is the empty second field

#Save (Ctrl+o), Close Editor (Ctrl+x)

#Now unmount microSD card partitions
sudo umount /media/usb/sda1
sudo umount /media/usb/sda2

#Now unplug USB Card reader from Pi, and remove microSD card from it.
#Slip-in microSD card in RPi and boot. 
#Now you should be able to log in as “pi” with no password.

#17

It is not a fresh or new install.
The sd card is at least a 3 month old card with very high stats.
Highest achieved Flightaware rating is - 10.
I want to save this card while enjoying to learn FlightAware on Pi.
It has been a good learning process.

If all else fails in the end i will just let the Pi run and forget about the Pi login/password.
So much for updates.


#18

The method advised by Oliver (obj) will NOT fail.

You will need another micoSD card. Write Piaware 3.5.1 image on it, remove your 3 months old card from Pi and slip in newly written card in Pi and boot.

Dont forget to create a file named ssh in /boot of the new microSD card while it is still in card reader pluged into desktop/laptop.

Now slip 3 month old card into a usb card reader, plug in the card reader in your Pi running new card, and follow STEP-BY-STEP METHOD USING ANOTHER PI", and your problem will be solved.


#19

@matthewsimons: If you are not confident about the method advised by obj, then wait. I will try it tonight on one of my existing microSD cards, and confirm the outcome.


#20

@matthewsimons:
I tried, and did remove the encrypted password for pi in file /media/usb/sda2/etc/shadow, but when I tried to save the modified file shadow, it did not save, saying that it is read only. :frowning_face::disappointed::cry: