#1105954 openssh-server: OpenSSH produces error on logout because utmp is no longer used

Package:
openssh-server
Source:
openssh-server
Description:
secure shell (SSH) server, for secure access from remote machines
Submitter:
Michael Johnson
Date:
2025-09-17 16:39:02 UTC
Severity:
normal
#1105954#5
Date:
2025-05-17 18:56:16 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   New/upgraded installation of Debian trixie produce an error on logging out
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
     Noticed the new log message in auth.log, if the file /var/run/utmp
     exists and has the correct permissions this error goes away
   * What was the outcome of this action?
   The error "sshd-session[1324]: syslogin_perform_logout: logout()
   returned an error" in the auth.log
   * What outcome did you expect instead?
   No error

*** End of the template - remove these template lines ***

#1105954#10
Date:
2025-09-17 16:36:00 UTC
From:
To:
Hi, I am a nosy bystander.

I see this log event on my Debian 13 systems.
I think this is because my systems have neither utmp nor wtmpdb.
I think on such systems, this error message is SAFE TO IGNORE.
I would still like this log event to be generated in the first place
(maybe with something like DoWtmp=no in /etc/ssh/sshd_config.d/foo.conf).

Here are some cross-references that are relevant:

utmp/wtmp are gone, wtmpdb is opt-in and not recommended:
https://www.debian.org/releases/trixie/release-notes/issues.html#the-last-lastb-and-lastlog-commands-have-been-replaced

openssh/trixie has wtmpdb enabled:
https://www.openssh.com/txt/release-10.0#line=236
https://sources.debian.org/src/openssh/1%3A10.0p1-7/debian/rules#L90

the error message is where openssh calls logout(), which seems to be
glibc updating utmp(5):
https://sources.debian.org/src/openssh/1%3A10.0p1-7/loginrec.c#L1480-L1500
https://manpages.debian.org/trixie/manpages-dev/logout.3.en.html
https://sourceware.org/glibc/manual/2.41/html_node/Logging-In-and-Out.html

I can't see anything in "man sshd_config" or in the code to let me
disable this.
I suspect "apt install wtmdb" is sufficient to make the log event go
away, but
at the cost of doing needless work (doing a sqlite3 UPSERT on logout).
I have not yet tested this suspicion.