SSH and Putty login suddenly no longer possible

  • Platform information: Openbab 4
    • Hardware:Raspberry PI 4 Model B
    • OS: Raspberry OH 4 OS
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 4

Hello all
I have the following problem, after I migrated from OH 3 to OH 4, my system was stable. I have also built a script that automatically creates a weekly backup and stores it in the BachupS folder. For a while I was also able to log in to my OH4 via Putty or Filezilla (SFTP).
For a few weeks now, I’ve been getting an error message saying that the user or PW is incorrect. However, I have never changed the user or the PW. Everything is still in the standard. I have only added new FTP users. However, they only have authorisation to access a specific folder. This login still works. Only the openhabian login no longer works. I wanted to make a backup of the backup in order to reset the system.
Does anyone have any idea how I can
a.) log in to the system differently
b.) I can somehow access the backup file

I have already tried to read the SD card on the Mac, which works, but I cannot find a backup file
Changing the PW in the openhab-config file directly on the SD card did not work either.
Could it be that my PI has a problem?
Thanks for any tips

ssh is a GNU/Linux service and is completely independent to openHAB. When setting up the system with openHABian (i.e. start from scratch with the opneHABian Image) the passwords are set from openhabian-config for all services.
You could gain access via chroot and change the password, but you can also mess up the system completely, so this is not a foolproof task.
As you have access via Mac, copy the backup files (/var/lib/openhab/backups/*.zip) to your Mac and delete them on the Micro SD Card, maybe you have only issues with disk space.

I haven’t done that on an openhabian system yet but other systems it is possible with monitor and keyboard to interupt the normal boot sequence to boot e.g. into single user mode or into a rescue shell.

Other possibility I would try:

  • create an image backup of you SD card
  • mount the linux partition on a different system and edit the /etc/shadow file which is dangerous as you need to know what you are doing. /etc/shadow contains the encryted passwords. So by direct editing you need to enter an encrypted password in the right place.

The backup files are located under the linux partition. There are two on the disk if you mounted the windows/fat partition you will not be able to find the backup files there.