Ssh server logind cannot get session ID

Hi,

Whenever I connect to my ssh server, either using a password, before I created a public key, or using the public key after I created it, the connection is successful and everything seems to be working fine, except for this log entry in the server journald:

sshd-session[9434]: logind: cannot get session ID

Although it doesn’t seem to affect anything, why does it occur and how can it be fixed please?

Thank you.

I’m using Leap 15.6.

I see in the logs:

2025-06-24T18:49:54.174484-05:00 nwr2 sshd[31553]: logind: cannot get session ID

I’m pretty sure that’s because I use:

UsePAM  no

in my sshd configuration. This prevents the login session from using the PAM stack, so it does not pickup the session information.

So, I guess it’s OK to leave it as is, right?

The UsePAM option does not exist in my sshd configuration though. So I guess no is the default setting for it.

Checking a Tumbleweed system:

According to “man sshd-config” the default is “no”.

However, “/usr/etc/sshd-config” contains

UsePAM yes

as the default openSUSE configuration for this. I override that with a file in “/etc/ssh/sshd-config.d”.

In any case, the log message that you are seeing does suggest that it is “no” on your system.

And yes, it is okay to leave things as they are, and ignore that log message – depending on your own needs.

1 Like

Out of curiosity - why?

Most of my ssh connections are for short transactions (“scp” or “rsync”), so I try to minimize the overhead. I have not run into any problems.