0

I have managed to lock myself out of my Raspberry PI 5.

I had installed Powershell, and configured my user to use Powershell as the default shell when logging in. This worked wonders.

Today I noticed when I logged into it that there was a new version of Powershell available, so I upgraded, but when I now try to log in, I get greeted with this:

lassevk@192.168.0.220: Permission denied (publickey).

so either the upgrade corrupted the Powershell files, or it doesn't work, or whatnot.

The question is, can I salvage this situation? Shutting down the RPI and connecting the disk (external SSD) to my desktop machine (Windows) only give me the bootfs. The shell configuration file is not available here.

Are there any of the configuration files on the bootfs where I can instruct the RPI to boot into some kind of "safe mode"?

My next option is to find a memory card, configure it to boot the RPI, and then plug in the external drive after boot and mount it, and then hopefully be able to check the state of things that way.

Any other options?

Edit: The duplicate link allowed me to get back into the RPI. The underlying problem was that the main powershell executable, pwsh was not set as executable.

Steps taken:

  1. Add the init=/bin/bash to the cmdline file
  2. Remount the file system as readwrite, mount -o remount, rw /
  3. Make the file executable, chmod +x /home/lassevk/.powershell/pwsh
  4. Remove the init=/bin/bash part again

0 Answers0