0

I'm running Raspbian Buster Lite on a board that I normally only access over SSH. The default login is pi/raspberry. I wanted to clear the password for convenience so I logged in and ran "sudo passwd -d root", which I often do on embedded linux systems. The command was accepted with the response "password expiry information changed" which is normal. However, now I am unable to log in over ssh with either a blank password or the original 'raspberry' password.

Is there a way to fix this or do I need to re-flash the memory card?

edit: I don't have a way to connect a monitor, so if I can't get in over SSH I'll have to wipe the memory card and start over. Which is not a huge deal, just a bit of wasted time.

edit2: Resolved now, after wiping the memory card.

AMTK
  • 111
  • 2

2 Answers2

0

According to this website, there are numerous ways to change the raspberry pi password. You can use the "Raspberry Pi Configuration" tool in the menu under "Preferences" (you need a monitor for this), you can run sudo raspi-config, select "system options" and "password", or you can run sudo passwd root and change the root password. In the future, don't clear the root password for the device! There is no need to use the root user, as anything can be accomplished with sudo.

PS(VERY IMPORTANT!!!): When trying to ssh into a raspberry pi you need to specify the username. For example, you would run ssh pi@192.168.1.30 to ssh into a raspberry pi with an IP of 192.168.1.30 and a username of "pi". Chances are, if you wiped the root password you should ssh as root: ssh root@192.168.1.30. I hope this helped!

Seamus
  • 23,558
  • 5
  • 42
  • 83
Quizzer515SY
  • 109
  • 4
0

It is unclear what you are trying to do. If is to remove a password you normally can't with the passwd command. Editing the /etc/shadow file can remove a password, but this is inadvisable.

The Raspberry Pi OS doesn't have a root password (and doesn't need one) and you can't ssh as root and AFAIK can't ssh without password, although you can set private/public keys to allow passwordless access.

To reset your password see:-

Headless Raspberry Pi 4 Password Reset?

Milliways
  • 62,573
  • 32
  • 113
  • 225