Can't login to my server after updating OH to 4.0.1 [Solved]

  • Platform information:
    • Hardware: AMD r5 / RAM: 8GB / Storage: 500GB SSD (laptop as a server)
    • OS: Debian 12
    • Java Runtime Environment: OpenJdk 11 (failed to update to 17 - probable source of troubles)
    • openHAB version: 4.0.1 Stable

I don’t know if its issue with OH or Linux itself, but I hope someone here can help me.

I’ve used openhabian to run the update of everything… as I always do twice a year. Something went wrong, so I checked any instructions what could be the issue and found out the wrong branch selected. Changed, reinstalled, still wrong. Checked logs, search the net and found out: Java failed to update.

So I’ve used this page as a tutorial how to update it: https://www.linuxcapable.com/how-to-install-openjdk-17-on-ubuntu-linux/
After command apt-cache search openjdk | grep openjdk-17 nothing was working anymore… Info that my user account could have been locked or lost permissions.
Than I’ve tried to run another session in putty, but nothing happened: Network error: Connection refused.
OK. Time to physically access the laptop. And I see a strange text:

Debian GNU/Linux 12 openhabian tty1

openhabian login:

Usually there was only Login: and absolutely nothing about openhabian. No username I know works. it’s not even asking me for password:

My admin login to OH doesn’t work also.
I’ve moved the drive to another PC to read the logins saved in /etc/passwd but nothing works. Nothing that even tries to ask me for password.
I’ve tried to write it with pattern: login:password but the result is still the same.
Any ideas how to access my laptop again?

BTW: Log Viewer still works (nothing that can help, everything related to wrong version of Java), also my Unify network manager works fine (is on the same machine).
I cannot do anything without going through this screen. No access to enabling, disabling services, updating, reading files, access normal login input…

The question is: what exactly did you do ?
I see that Debian 12 is installed. Is that the OS that you initially installed or is this a result of all the upgrade steps that you did ?
openhabian must be the hostname as it is shown in the header of your screenshot.
openhab is not an account in the normal openhabian install procedure.
So you need to try openhabian with password openhabian.
But the install procedure of openhabian-config also asks if you would like to change the defaults so this is something that you need to remember…

What you can dof if you do not remember the user / password plug a life usb stick with e.g. rescue os or ubuntu or debian to your notebook.
Boot from that stick. Mount the disk’s partition and then access /etc/passwd reps. etc/shadow file from the mounted partition. This will give you an idea about the used account.
You then need to edit the shadow file and put in an encrypted password ( empty password may work ).

Debian is the OS of my choice. It was installed a few years ago.
I’ve left all the logins and passwords default.
As you can see I’ve already tried openhabian as user name.
I DO remember the password for my su account. but it’s not working! It’s not even asking me for password as you can see on the “screenshot”.
No username from passwd or shadow seems to be working (still not asking for password)

Seems you’re asking me to do thing that I’ve already done and written about it…

IT’S NOT ASKING FOR PASSWORD NO MATTER WHAT USERNAME I INPUT. What can I do?

Haven’t seen that before but according to https://unix.stackexchange.com/questions/748744/stuck-at-boot-no-gui-login-on-tty-not-possible-after-upgrade-to-debian-12 and although for an other linux OS: https://www.suse.com/support/kb/doc/?id=000017387
this can happen …
Mount the partition and check for the file etc/nologin. Remove it and boot from the disk again.

In the first link I can see the same issue as mine, but no solution…
I can see no such file as /etc/nologin
There’s usr/sbin/nologin - should I remove it?

BTW: I have no GUI installed, because I’ve decided I don’t need that.

That’s fine.

No.

In case /etc/nologin is not available on the server it must be a different reason for the problem.
Please also check if that file does not exist in directory /var/run.

Did you check the log files on the server after trying to login ( of course it is required to shutdown the server and mount its partition again ) ?
Also check if files exist in /var/run/log/journal/. The can be opened using the command

journalctl --file /path/to/some/file.journal

/var/run seems to be empty.
Also I’m running Linux Reader on Windows right now. It’s read only, but was fine until I didn’t know what to edit.
Is it possible that for some reason I can’t see the files but they are there?
I’m rather bad in working with Linux, I have no idea where to look for logs.

For now I’d try to run OpenHab on Windows, but it’s hard to find any help with this approach… I can’t even find the config file to change port number.

I am not familiar with Linux Reader on Windows but I doubt that all but the files that we are looking for are shown.

Have a look to /var/log/ directory it contains all sort of log files.
/var/log/syslog /var/log/messages collect system messages.
/var/log/auth.log may contain information about login trials.
/var/run is a symlink and should point to /run. So you may check if the file is located in /run/log/journal/.

In auth.log I can see:

PAM unable to dlopen (pam_unix.so) /lib/security/pam_unix.so: cannot open shared object file: no such file or directory
PAM adding faulty module: pam_unix.so

But I can see it’s still not created and this messages repeats all the time…
There’s no such a directory as ‘security’ under /lib
Well… I think it’s time to create this directory and see what happens.

openHABian is not supported on Ubuntu. Never has been in fact. As have been stating the docs in a long time.

Usually upgrading from within openhabian-config won’t change anything about accounts or credentials but then again I have no idea what happened, can have been anything, it’s Terra Incognita, the nature of and reason for Ubuntu not being supported.
You’ll have to figure out yourself.

You’d be better off with using a generic Debian OS installation or a dedicated Raspberry.
openHABian is only supprted on these.

This will not work.

the directory should contain a library.

This means:

  • when you try to login so called PAM ( Plugable Authentication Modules ) is being called.
  • PAM is configurable …
  • during the logon process PAM is called and tries to open the pam_unix.so module
  • the module is not there
  • you get an error message in the log file and on the screen
  • result is that no user can login

This should not happen. Either something is wrong with the basic installation of Debian 12 on your system or this is due to an imcompatibility between openhabian-config and Debian 12 ( Debian 11 is recommended )
I doubt that you can repair this problem as long as you just open it from within Windows. You would have to boot a Debian Live image mount your Debian 12 partition and do a chroot from within that one it could be possible to repair the installed system but this is not something for beginners - sorry for that.

Either try install Debian 12 again or better install Debian 11 as that is the supported version for openhabian-config.
I would do this in two steps. First one install the OS. Then try it. Then install openhabian and try it again.

1 Like

I’ve already switched to Debian Live.
I’d love to not reinstall Debian, it took me quite a lot of time to make it all run as I need.
At least I know what to look for so will see if I can do anything.

Fixed with idiot way:
Downloaded files from net (searching “download pam_unix.so”) and placed a few files into the directory from log.
Restart, still wrong, boot Live image, read logs: now missing libcrypt.so.1, copied form Live pendrive.
PROFIT

It was all the result of failed Debian update (auto update everything using openhabian).

Thanks a lot @Wolfgang_S without you I would never find out what to look for.

SSH is still down, Java waits for update, but that’s another topic, I think I can do this myself.
Consider this topic closed.

1 Like